|
| 1 | +# pylint: disable=no-name-in-module |
| 2 | +from behave import given, when, then # pyright: ignore [reportAttributeAccessIssue] |
| 3 | +from playwright.sync_api import expect |
| 4 | + |
| 5 | +from pages.confirm_role import ConfirmRole |
| 6 | + |
| 7 | + |
| 8 | +############################################################################ |
| 9 | +# GIVEN STEPS |
| 10 | +############################################################################ |
| 11 | + |
| 12 | + |
| 13 | +@given("I am on the confirm your role page") |
| 14 | +def i_am_on_the_confirm_your_role_page(context): |
| 15 | + context.execute_steps("given I go to the select your role page") |
| 16 | + context.execute_steps("given I have a selected role") |
| 17 | + context.execute_steps("then I see the 'confirm your role' page") |
| 18 | + |
| 19 | + |
| 20 | +############################################################################ |
| 21 | +# WHEN STEPS |
| 22 | +############################################################################ |
| 23 | + |
| 24 | + |
| 25 | +@when("I click the change link next to the role text") |
| 26 | +def i_click_the_change_link_next_to_the_role_text(context): |
| 27 | + confirm_role_page = ConfirmRole(context.page) |
| 28 | + confirm_role_page.role_change_role.click() |
| 29 | + |
| 30 | + |
| 31 | +@when("I click the change link next to the org text") |
| 32 | +def i_click_the_change_link_next_to_the_org_text(context): |
| 33 | + confirm_role_page = ConfirmRole(context.page) |
| 34 | + confirm_role_page.org_change_role.click() |
| 35 | + |
| 36 | + |
| 37 | +@when("I click the confirm and continue button on the confirm role page") |
| 38 | +def i_click_the_confirm_and_continue_button_on_the_confirm_role_page(context): |
| 39 | + confirm_role_page = ConfirmRole(context.page) |
| 40 | + confirm_role_page.confirm_button.click() |
| 41 | + |
| 42 | + |
| 43 | +############################################################################ |
| 44 | +# THEN STEPS |
| 45 | +############################################################################ |
| 46 | + |
| 47 | + |
| 48 | +@then("I see the 'confirm your role' page") |
| 49 | +def i_see_the_confirm_your_role_page(context): |
| 50 | + confirm_role_page = ConfirmRole(context.page) |
| 51 | + |
| 52 | + expect(confirm_role_page.header).to_be_visible() |
| 53 | + expect(confirm_role_page.role_label_cell).to_be_visible() |
| 54 | + expect(confirm_role_page.org_label_cell).to_be_visible() |
| 55 | + expect(confirm_role_page.org_text_cell).to_be_visible() |
| 56 | + expect(confirm_role_page.role_text_cell).to_be_visible() |
| 57 | + expect(confirm_role_page.role_change_role).to_be_visible() |
| 58 | + expect(confirm_role_page.org_change_role).to_be_visible() |
0 commit comments