Skip to content

Commit

Permalink
Update the source.
Browse files Browse the repository at this point in the history
  • Loading branch information
vasanthlmsace committed Nov 14, 2024
1 parent c9cd14b commit b07ef29
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 22 deletions.
21 changes: 19 additions & 2 deletions tests/behat/behat_format_kickstart.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,31 @@
*/
class behat_format_kickstart extends behat_base {

/**
* @Given /^I check single activity condition kickstart:$/
* @param string $format The course data
*/
public function i_check_single_activity_condition_kickstart(TableNode $table) {
global $CFG;
# And I start watching to see if a new page loads
# And I set the following fields to these values:
# | Forum name | Test Forum |
# Then I press "Save and display"
# Then I should see ""
if ($CFG->branch <= '403') {
$this->execute('behat_forms::i_set_the_following_fields_to_these_values', $table);
$this->execute('behat_forms::press_button', "Save and display");
}
$this->execute('behat_general::assert_page_contains_text', "There are no discussion topics yet in this forum");
}

/**
* @Given /^I should see course format "(?P<element_string>(?:[^"]|\\")*)"$/
* @param string $format The course data
*/
public function i_should_see_define_course_format($format) {
global $CFG;
if ($CFG->branch <= '402') {
if ($CFG->branch <= '403') {
switch($format) {
case 'Single activity':
$format = 'Single activity format';
Expand All @@ -70,7 +87,7 @@ public function i_should_see_define_course_format($format) {
*/
public function i_should_not_see_define_course_format($format) {
global $CFG;
if ($CFG->branch <= '402') {
if ($CFG->branch <= '403') {
switch($format) {
case 'Single activity':
$format = 'Single activity format';
Expand Down
22 changes: 2 additions & 20 deletions tests/behat/format_kickstart_visibility.feature
Original file line number Diff line number Diff line change
Expand Up @@ -163,34 +163,16 @@ Feature: Check the kickstart course format features.
Then I should see "Course 2"
Then ".course-content" "css_element" should exist

Scenario: Check the visible course templates in different roles
Given I log in as "user1"
Then I am on "Course 1" course homepage
#Then I wait "5" seconds
# Todo:
#And I click kickstart template ".use-template[data-templatename=\"Custom sections\"]"
Then I click on ".template-list .card-deck .card:nth-child(2) .card-footer a" "css_element"
And I click on "Import" "button" in the ".modal" "css_element"
And I start watching to see if a new page loads
Then I should see "Course 1"
Then ".course-content" "css_element" should exist

Scenario: Check the single activity format template
Given I log in as "admin"
And I am on "Course 3" course homepage with editing mode on
And I should see course format "Single activity"
# Todo:
#And I click kickstart template ".use-template[data-templatename=\"Single activity\"]"
Then I click on ".template-list .card-deck:nth-child(2) .card:nth-child(2) .card-footer a" "css_element"
#Then I wait "10" seconds
And I click on "Import" "button" in the ".modal" "css_element"
# And I start watching to see if a new page loads
# Then I wait "10" seconds
# And I set the following fields to these values:
# | Forum name | Test Forum |
# Then I press "Save and display"
#Then I should see "There are no discussion topics yet in this forum"
And I should see "There are no discussion topics yet in this forum" in the ".alert-info" "css_element"
And I check single activity condition kickstart:
| Forum name | Test Forum |
And I navigate to "Plugins > Course formats > Manage templates" in site administration
# Todo:
#Then I click on "Edit" "button" in the "Single activity" "table_row"
Expand Down

0 comments on commit b07ef29

Please sign in to comment.