Commit 83df703f authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1770281: Fixing behat to accept confirm click of delete button



Added 'I click on "button" delete button' step so that the delete
buttons with 'confirm' popup get accepted

Change-Id: I0ec7d268cd275efb1398b58c26d87f3e8ffdc092
Signed-off-by: default avatarRobert Lyon <robertl@catalyst.net.nz>
(cherry picked from commit cfed69ea)
parent c8b2da1b
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -346,6 +346,21 @@ class BehatGeneral extends BehatBase {
//         }
    }

    /**
     * Click on the delete confirm link or button.
     *
     * @When /^I click on "(?P<link_or_button>(?:[^"]|\\")*)" delete button$/
     * @param string $link_or_button we look for
     */
    public function i_click_on_delete($link_or_button) {

        // Gets the node based on the requested selector type and locator.
        $node = $this->get_selected_node('link_or_button', $link_or_button);
        $this->ensure_node_is_visible($node);
        $node->click();
        $this->getSession()->getDriver()->getWebDriverSession()->accept_alert();
    }

    /**
     * Press the key.
     *
+4 −4
Original line number Diff line number Diff line
@@ -109,9 +109,9 @@ Scenario: Editing Education and Employment info
    And I click on "Move down" in "Test Analyst" row
    And I click on "Move up" in "Test Analyst" row
    # delete employment and education history  (Bug 1755669)
    And I scroll to the top
    Given I click on "Delete \"North American Cultural Studies (Masters of Arts) at University of Life\""
    Given I click on "Delete \"Code Ninja: Xero\""
    And I scroll to the base of id "employmenthistorylist"
    And I click on "Delete \"North American Cultural Studies (Masters of Arts) at University of Life\"" delete button
    And I click on "Delete \"Code Ninja: Xero\"" delete button

    # When entire resume is displayed on Profile page, it should include employment address (Bug 1529750)
    Given I choose "Pages and collections" in "Portfolio" from main menu
@@ -221,7 +221,7 @@ Scenario: Adding Achievements
    And I click on "Move down" in "Accredited Technologist" row
    And I click on "Move up" in "Accredited Technologist" row
    # check achievements can be deleted (Bug 1755669)
    And I click on "Delete \"sdrtyh\""
    And I click on "Delete \"sdrtyh\"" delete button
    And I wait "1" seconds
    And I should not see "sdrtyh"