Skip to content

Commit

Permalink
fix behat test to proceed via "importing" (#807)
Browse files Browse the repository at this point in the history
  • Loading branch information
semteacher committed Jan 20, 2025
1 parent 4c56831 commit ceeb869
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 43 deletions.
8 changes: 4 additions & 4 deletions tests/behat/booking_campaigns.feature
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ Feature: Create booking campaigns for booking options as admin and booking it as
| 2 | discount1 | Disc1 | 77 | 0 | 2 |
| 3 | discount2 | Disc2 | 66 | 0 | 3 |
And the following "mod_booking > options" exist:
| booking | text | course | description | maxanswers | datesmarker | optiondateid_1 | daystonotify_1 | coursestarttime_1 | courseendtime_1 | optiondateid_2 | daystonotify_2 | coursestarttime_2 | courseendtime_2 | useprice | customfield_spt1 |
| BookingCMP | Option-tenis | C1 | Price-tenis | 1 | 1 | 0 | 0 | ## tomorrow ## | ## +2 days ## | 0 | 0 | ## +3 days ## | ## +4 days ## | 1 | tenis |
| BookingCMP | Option-football | C1 | Price-football | 2 | 1 | 0 | 0 | ## +2 days ## | ## +3 days ## | 0 | 0 | ## +4 days ## | ## +4 days ## | 1 | football |
| BookingCMP | Option-yoga | C1 | Yoga-noprice | 3 | 1 | 0 | 0 | ## +2 days ## | ## +3 days ## | 0 | 0 | ## +4 days ## | ## +4 days ## | 0 | yoga |
| booking | text | course | description | importing | maxanswers | datesmarker | optiondateid_1 | daystonotify_1 | coursestarttime_1 | courseendtime_1 | optiondateid_2 | daystonotify_2 | coursestarttime_2 | courseendtime_2 | useprice | customfield_spt1 |
| BookingCMP | Option-tenis | C1 | Price-tenis | 1 | 1 | 1 | 0 | 0 | ## tomorrow ## | ## +2 days ## | 0 | 0 | ## +3 days ## | ## +4 days ## | 1 | tenis |
| BookingCMP | Option-football | C1 | Price-football | 1 | 2 | 1 | 0 | 0 | ## +2 days ## | ## +3 days ## | 0 | 0 | ## +4 days ## | ## +4 days ## | 1 | football |
| BookingCMP | Option-yoga | C1 | Yoga-noprice | 1 | 3 | 1 | 0 | 0 | ## +2 days ## | ## +3 days ## | 0 | 0 | ## +4 days ## | ## +4 days ## | 0 | yoga |
And I change viewport size to "1366x10000"

@javascript
Expand Down
12 changes: 6 additions & 6 deletions tests/behat/booking_campaigns2.feature
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ Feature: Create booking campaigns2 for booking options as admin and booking it a
| 2 | discount1 | Disc1 | 77 | 0 | 2 |
| 3 | discount2 | Disc2 | 66 | 0 | 3 |
And the following "mod_booking > options" exist:
| booking | text | course | description | customfield_bcustom1 | useprice | maxanswers | datesmarker | optiondateid_1 | daystonotify_1 | coursestarttime_1 | courseendtime_1 |
| BookingCMP | Option-exclude | C1 | NoPrice-exclude | exclude | 0 | 6 | 1 | 0 | 0 | ## tomorrow ## | ## +2 days ## |
| BookingCMP | Option-nocustom | C1 | nocustom | | 0 | 6 | 1 | 0 | 0 | ## tomorrow ## | ## +2 days ## |
| BookingCMP | Option-include | C1 | NoPrice-include | include | 0 | 6 | 1 | 0 | 0 | ## tomorrow ## | ## +3 days ## |
| BookingCMP | Option-priceexclude | C1 | Price-exclude | exclude | 1 | 6 | 1 | 0 | 0 | ## tomorrow ## | ## +3 days ## |
| BookingCMP | Option-priceinclude | C1 | Price-include | include | 1 | 6 | 1 | 0 | 0 | ## tomorrow ## | ## +3 days ## |
| booking | text | course | description | importing | customfield_bcustom1 | useprice | maxanswers | datesmarker | optiondateid_1 | daystonotify_1 | coursestarttime_1 | courseendtime_1 |
| BookingCMP | Option-exclude | C1 | NoPrice-exclude | 1 | exclude | 0 | 6 | 1 | 0 | 0 | ## tomorrow ## | ## +2 days ## |
| BookingCMP | Option-nocustom | C1 | nocustom | 1 | | 0 | 6 | 1 | 0 | 0 | ## tomorrow ## | ## +2 days ## |
| BookingCMP | Option-include | C1 | NoPrice-include | 1 | include | 0 | 6 | 1 | 0 | 0 | ## tomorrow ## | ## +3 days ## |
| BookingCMP | Option-priceexclude | C1 | Price-exclude | 1 | exclude | 1 | 6 | 1 | 0 | 0 | ## tomorrow ## | ## +3 days ## |
| BookingCMP | Option-priceinclude | C1 | Price-include | 1 | include | 1 | 6 | 1 | 0 | 0 | ## tomorrow ## | ## +3 days ## |
And the following "mod_booking > answers" exist:
| booking | option | user |
| BookingCMP | Option-exclude | student4 |
Expand Down
12 changes: 6 additions & 6 deletions tests/behat/booking_campaigns3.feature
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ Feature: Create booking campaigns3 for booking options as admin and booking it a
| 2 | discount1 | Disc1 | 77 | 0 | 2 |
| 3 | discount2 | Disc2 | 66 | 0 | 3 |
And the following "mod_booking > options" exist:
| booking | text | course | description | customfield_bexcluded1 | useprice | maxanswers | datesmarker | optiondateid_1 | daystonotify_1 | coursestarttime_1 | courseendtime_1 |
| BookingCMP | Option-exclude | C1 | NoPrice-excl_yes | yes | 0 | 6 | 1 | 0 | 0 | ## tomorrow ## | ## +2 days ## |
| BookingCMP | Option-include | C1 | NoPrice-excl_no | no | 0 | 6 | 1 | 0 | 0 | ## tomorrow ## | ## +3 days ## |
| BookingCMP | Option-nocustom | C1 | nocustom | | 0 | 6 | 1 | 0 | 0 | ## tomorrow ## | ## +2 days ## |
| BookingCMP | Option-priceexclude | C1 | Price-excl_yes | yes | 1 | 6 | 1 | 0 | 0 | ## tomorrow ## | ## +3 days ## |
| BookingCMP | Option-priceinclude | C1 | Price-excl_no | no | 1 | 6 | 1 | 0 | 0 | ## tomorrow ## | ## +3 days ## |
| booking | text | course | description | importing | customfield_bexcluded1 | useprice | maxanswers | datesmarker | optiondateid_1 | daystonotify_1 | coursestarttime_1 | courseendtime_1 |
| BookingCMP | Option-exclude | C1 | NoPrice-excl_yes | 1 | yes | 0 | 6 | 1 | 0 | 0 | ## tomorrow ## | ## +2 days ## |
| BookingCMP | Option-include | C1 | NoPrice-excl_no | 1 | no | 0 | 6 | 1 | 0 | 0 | ## tomorrow ## | ## +3 days ## |
| BookingCMP | Option-nocustom | C1 | nocustom | 1 | | 0 | 6 | 1 | 0 | 0 | ## tomorrow ## | ## +2 days ## |
| BookingCMP | Option-priceexclude | C1 | Price-excl_yes | 1 | yes | 1 | 6 | 1 | 0 | 0 | ## tomorrow ## | ## +3 days ## |
| BookingCMP | Option-priceinclude | C1 | Price-excl_no | 1 | no | 1 | 6 | 1 | 0 | 0 | ## tomorrow ## | ## +3 days ## |
And I change viewport size to "1366x10000"

## @javascript
Expand Down
30 changes: 15 additions & 15 deletions tests/behat/booking_installments.feature
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ Feature: Enabling installments as admin configuring installments as a teacher an
@javascript
Scenario: Add an installmetn for a booking option as a teacher and verify it
Given the following "mod_booking > options" exist:
| booking | text | course | description | useprice | limitanswers | maxanswers | optiondateid_1 | daystonotify_1 | coursestarttime_1 | courseendtime_1 |
| BookingInst | Option-installment | C1 | Deskr2 | 1 | 1 | 4 | 0 | 0 | ## +5 days ## | ## +8 days ## |
| booking | text | course | description | importing | useprice | limitanswers | maxanswers | optiondateid_1 | daystonotify_1 | coursestarttime_1 | courseendtime_1 |
| BookingInst | Option-installment | C1 | Deskr2 | 1 | 1 | 1 | 4 | 0 | 0 | ## +5 days ## | ## +8 days ## |
And I am on the "BookingInst" Activity page logged in as teacher1
And I click on "Settings" "icon" in the ".allbookingoptionstable_r1" "css_element"
And I click on "Edit booking option" "link" in the ".allbookingoptionstable_r1" "css_element"
Expand Down Expand Up @@ -88,23 +88,23 @@ Feature: Enabling installments as admin configuring installments as a teacher an
@javascript
Scenario: Add an installment for a booking option via DB and brought it as student
Given the following "mod_booking > options" exist:
| booking | text | course | description | useprice | sch_allowinstallment | sch_downpayment | sch_numberofpayments | sch_duedaysbeforecoursestart | optiondateid_1 | daystonotify_1 | coursestarttime_1 | courseendtime_1 |
| BookingInst | Option-installment | C1 | Deskr2 | 1 | 1 | 44 | 2 | 1 | 0 | 0 | ## +6 days ## | ## +8 days ## |
| booking | text | course | description | importing | useprice | sch_allowinstallment | sch_downpayment | sch_numberofpayments | sch_duedaysbeforecoursestart | optiondateid_1 | daystonotify_1 | coursestarttime_1 | courseendtime_1 |
| BookingInst | Option-installment | C1 | Deskr2 | 1 | 1 | 1 | 44 | 2 | 1 | 0 | 0 | ## +6 days ## | ## +8 days ## |
And I am on the "BookingInst" Activity page logged in as student1
And I click on "Add to cart" "text" in the ".allbookingoptionstable_r1 .booknow" "css_element"
And I visit "/local/shopping_cart/checkout.php"
And I wait until the page is ready
And I set the field "Use installment payments" to "checked"
And I wait "1" seconds
## Disabled because of constant failures at GitHub. Working locally. See https://github.com/Wunderbyte-GmbH/moodle-mod_booking/issues/633 for detail
##And I should see "Down payment for Option-installment"
##And I should see "44 EUR instead of 88 EUR"
##And I should see "Further payments"
##And I should see "2" occurrences of "22 EUR on" in the ".sc_installments .furtherpayments" "css_element"
##When I press "Checkout"
##And I wait "1" seconds
##And I press "Confirm"
##And I wait until the page is ready
##Then I should see "Payment successful!"
##And I should see "Option-installment" in the ".payment-success ul.list-group" "css_element"
##And I should see "44.00 EUR" in the ".payment-success ul.list-group" "css_element"
And I should see "Down payment for Option-installment"
And I should see "44 EUR instead of 88 EUR"
And I should see "Further payments"
And I should see "2" occurrences of "22 EUR on" in the ".sc_installments .furtherpayments" "css_element"
When I press "Checkout"
And I wait "1" seconds
And I press "Confirm"
And I wait until the page is ready
Then I should see "Payment successful!"
And I should see "Option-installment" in the ".payment-success ul.list-group" "css_element"
And I should see "44.00 EUR" in the ".payment-success ul.list-group" "css_element"
8 changes: 4 additions & 4 deletions tests/behat/booking_manage_waiting_list.feature
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ Feature: In a course add a booking option and manage its waiting list
@javascript
Scenario: Booking option: reorder waiting list
Given the following "mod_booking > options" exist:
| booking | text | course | description | teachersforoption | maxanswers | maxoverbooking | datesmarker | optiondateid_1 | daystonotify_1 | coursestarttime_1 | courseendtime_1 | waitforconfirmation |
| My booking | Option: waiting list | C1 | Waiting list | teacher1 | 5 | 5 | 1 | 0 | 0 | ## tomorrow ## | ## +2 days ## | 1 |
| booking | text | course | description | importing | teachersforoption | maxanswers | maxoverbooking | datesmarker | optiondateid_1 | daystonotify_1 | coursestarttime_1 | courseendtime_1 | waitforconfirmation |
| My booking | Option: waiting list | C1 | Waiting list | 1 | teacher1 | 5 | 5 | 1 | 0 | 0 | ## tomorrow ## | ## +2 days ## | 1 |
Given I am on the "My booking" Activity page logged in as teacher1
And I click on "Settings" "icon" in the ".allbookingoptionstable_r1" "css_element"
And I click on "Book other users" "link" in the ".allbookingoptionstable_r1" "css_element"
Expand Down Expand Up @@ -94,8 +94,8 @@ Feature: In a course add a booking option and manage its waiting list
| config | value | plugin |
| pricecategoryfield | userpricecat | booking |
And the following "mod_booking > options" exist:
| booking | text | course | description | teachersforoption | useprice | maxanswers | maxoverbooking | datesmarker | optiondateid_1 | daystonotify_1 | coursestarttime_1 | courseendtime_1 | waitforconfirmation |
| My booking | Waiting_list_with_price | C1 | Waiting list | teacher1 | 1 | 2 | 3 | 1 | 0 | 0 | ## tomorrow ## | ## +2 days ## | 1 |
| booking | text | course | description | importing | teachersforoption | useprice | maxanswers | maxoverbooking | datesmarker | optiondateid_1 | daystonotify_1 | coursestarttime_1 | courseendtime_1 | waitforconfirmation |
| My booking | Waiting_list_with_price | C1 | Waiting list | 1 | teacher1 | 1 | 2 | 3 | 1 | 0 | 0 | ## tomorrow ## | ## +2 days ## | 1 |
And the following "mod_booking > answers" exist:
| booking | option | user |
| My booking | Waiting_list_with_price | student1 |
Expand Down
8 changes: 4 additions & 4 deletions tests/behat/booking_pricecancelation.feature
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ Feature: Create booking option with price and force students answer as admin tha
| activity | course | name | intro | bookingmanager | eventtype | cancancelbook | Default view for booking options | Send confirmation e-mail |
| booking | C1 | BookingCMP | Booking description | teacher1 | Webinar | 1 | All bookings | Yes |
And the following "mod_booking > options" exist:
| booking | text | course | description | maxanswers | datesmarker | optiondateid_1 | daystonotify_1 | coursestarttime_1 | courseendtime_1 | useprice | canceluntil | canceluntilcheckbox |
| BookingCMP | Option-tenis | C1 | Price-tenis | 4 | 1 | 0 | 0 | ## +2 days ## | ## +3 days ## | 1 | ## tomorrow ## | 1 |
| BookingCMP | Option-football | C1 | Price-football | 4 | 1 | 0 | 0 | ## +3 days ## | ## +4 days ## | 1 | ## tomorrow ## | 1 |
| BookingCMP | Option-xconsume | C1 | Price-xconsume | 4 | 1 | 0 | 0 | ## -48 hours ## | ## +72 hours ## | 1 | ## tomorrow ## | 1 |
| booking | text | course | description | importing | maxanswers | datesmarker | optiondateid_1 | daystonotify_1 | coursestarttime_1 | courseendtime_1 | useprice | canceluntil | canceluntilcheckbox |
| BookingCMP | Option-tenis | C1 | Price-tenis | 1 | 4 | 1 | 0 | 0 | ## +2 days ## | ## +3 days ## | 1 | ## tomorrow ## | 1 |
| BookingCMP | Option-football | C1 | Price-football | 1 | 4 | 1 | 0 | 0 | ## +3 days ## | ## +4 days ## | 1 | ## tomorrow ## | 1 |
| BookingCMP | Option-xconsume | C1 | Price-xconsume | 1 | 4 | 1 | 0 | 0 | ## -48 hours ## | ## +72 hours ## | 1 | ## tomorrow ## | 1 |
And the following "core_payment > payment accounts" exist:
| name |
| Account1 |
Expand Down
4 changes: 2 additions & 2 deletions tests/behat/booking_prices.feature
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ Feature: As an admin - configure booking's prices feature and validate it as stu
| activity | course | name | intro | bookingmanager | eventtype | Default view for booking options |
| booking | C1 | BookingCMP | Booking description | teacher1 | Webinar | All bookings |
And the following "mod_booking > options" exist:
| booking | text | course | description | useprice | maxanswers | datesmarker | optiondateid_1 | daystonotify_1 | coursestarttime_1 | courseendtime_1 |
| BookingCMP | Option-price | C1 | Price | 1 | 6 | 1 | 0 | 0 | ## tomorrow ## | ## +2 days ## |
| booking | text | course | description | importing | useprice | maxanswers | datesmarker | optiondateid_1 | daystonotify_1 | coursestarttime_1 | courseendtime_1 |
| BookingCMP | Option-price | C1 | Price | 1 | 1 | 6 | 1 | 0 | 0 | ## tomorrow ## | ## +2 days ## |
And I change viewport size to "1366x10000"

@javascript
Expand Down
Loading

0 comments on commit ceeb869

Please sign in to comment.