Skip to content

Commit

Permalink
Moodle plugin Ci updated.
Browse files Browse the repository at this point in the history
  • Loading branch information
raja-lmsace committed Jan 17, 2024
1 parent 6dc7620 commit 5314140
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 10 deletions.
30 changes: 30 additions & 0 deletions tests/behat/behat_tool_skills.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,34 @@ public function i_create_skill_with_the_following_fields_to_these_values(TableNo
$this->execute("behat_general::i_click_on", ["Save changes", "button"]);
}

/**
* This can be used on confirmation message css element.
*
* @Given /^I navigate to confirmation$/
*
* @throws ExpectationException
* @return void
*/
public function i_navigate_to_confirmation() {
global $CFG;

$cssclass = ($CFG->branch <= "402") ? '.confirmation-dialogue' : '.modal-footer';
$this->execute("behat_general::i_click_on", ["Yes", "button", $cssclass, "css_element"]);
}

/**
* Confirmation messages text.
*
* @Given /^I should see "(?P<messagetext>(?:[^"]|\\")*)" message confirmation$/
* @param string $messagetext Messagetext.
*/
public function i_should_see_message_confirmation($messagetext) {
global $CFG;

$cssclass = ($CFG->branch <= "402") ? '.confirmation-dialogue' : '.modal-body';
$this->execute("behat_general::assert_element_contains_text", [
"Are you sure! do you want to $messagetext this skill and its levels",
$cssclass, "css_element"]);
}

}
20 changes: 10 additions & 10 deletions tests/behat/tool_skills_general.feature
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ Feature: Configuring the tool_skills plugin on the "Skills" page, applying diffe
And I click on "Save changes" "button"
And I should see "Begineer" in the "tool_skills_list" "table"
And I click on ".skill-item-actions .action-archive" "css_element" in the "begineer" "table_row"
And I should see "Are you sure! do you want to archive this skill and its levels" in the ".confirmation-dialogue" "css_element"
And I click on "Yes" "button" in the ".confirmation-dialogue" "css_element"
And I should see "archive" message confirmation
And I navigate to confirmation
And I should see "Begineer" in the "tool_skills_archived_list" "table"
And I click on "Active skills" "link"
Then I should see "Skills are not created yet or not in use"
And I click on "Archived skills" "link"
And I click on ".skill-item-actions .action-active" "css_element" in the "begineer" "table_row"
And I should see "Are you sure! do you want to activate this skill and its levels" in the ".confirmation-dialogue" "css_element"
And I click on "Yes" "button" in the ".confirmation-dialogue" "css_element"
And I should see "activate" message confirmation
And I navigate to confirmation
And I should see "Begineer" in the "tool_skills_list" "table"

@javascript
Expand All @@ -100,11 +100,11 @@ Feature: Configuring the tool_skills plugin on the "Skills" page, applying diffe
| Level #0 point | 10 |
And I should see "Begineer" in the "tool_skills_list" "table"
And I click on ".skill-item-actions .action-archive" "css_element" in the "begineer" "table_row"
And I click on "Yes" "button" in the ".confirmation-dialogue" "css_element"
And I navigate to confirmation
And I click on "Archived skills" "link"
And I click on ".skill-item-actions .action-delete" "css_element" in the "begineer" "table_row"
And I should see "Are you sure! do you want to delete this skill and its levels" in the ".confirmation-dialogue" "css_element"
And I click on "Yes" "button" in the ".confirmation-dialogue" "css_element"
And I should see "delete" message confirmation
And I navigate to confirmation
Then I should not see "Begineer" in the "#region-main" "css_element"
And I create skill with the following fields to these values:
| Skill name | Critical thinker |
Expand All @@ -117,11 +117,11 @@ Feature: Configuring the tool_skills plugin on the "Skills" page, applying diffe
Then I should see "Critical thinker"
And I navigate to skills
And I click on ".skill-item-actions .action-archive" "css_element" in the "critical-thinker" "table_row"
And I click on "Yes" "button" in the ".confirmation-dialogue" "css_element"
And I navigate to confirmation
And I click on "Archived skills" "link"
And I click on ".skill-item-actions .action-delete" "css_element" in the "critical-thinker" "table_row"
And I should see "Are you sure! do you want to delete this skill and its levels" in the ".confirmation-dialogue" "css_element"
And I click on "Yes" "button" in the ".confirmation-dialogue" "css_element"
And I should see "delete" message confirmation
And I navigate to confirmation
Then I am on "Course 1" course homepage
And I click on "More" "link" in the ".secondary-navigation" "css_element"
And I click on "Manage skills" "link"
Expand Down

0 comments on commit 5314140

Please sign in to comment.