Skip to content

Commit

Permalink
Added wait for element in if-then-else test
Browse files Browse the repository at this point in the history
  • Loading branch information
gbisurgi committed Jun 28, 2023
1 parent c23c5c3 commit 5ca0ae3
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/codeceptjs/constrains/if-then-else_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,23 68,27 @@ Scenario('validate agaist if-then-else @if-then-else', async ({ I }) => {
I.waitForElement('.je-ready')

I.selectOption('[name="root[country]"]', 'America')
I.waitForElement('[name="root[postal_code]"]')
I.fillField('[name="root[postal_code]"]', 'K1M 1M4')
I.pressKey('Tab')
I.waitForElement('.invalid-feedback')
I.waitForText('Value must match the pattern [0-9]{5}(-[0-9]{4})?.')

I.selectOption('[name="root[country]"]', 'Canada')
I.waitForElement('[name="root[postal_code]"]')
I.fillField('[name="root[postal_code]"]', '10000')
I.pressKey('Tab')
I.waitForElement('.invalid-feedback')
I.waitForText('Value must match the pattern [A-Z][0-9][A-Z] [0-9][A-Z][0-9].')

I.selectOption('[name="root[country]"]', 'America')
I.waitForElement('[name="root[postal_code]"]')
I.fillField('[name="root[postal_code]"]', '10000')
I.pressKey('Tab')
I.dontSee('.invalid-feedback')

I.selectOption('[name="root[country]"]', 'Canada')
I.waitForElement('[name="root[postal_code]"]')
I.fillField('[name="root[postal_code]"]', 'K1M 1M4')
I.pressKey('Tab')
I.dontSee('.invalid-feedback')
Expand All @@ -95,22 99,26 @@ Scenario('validate agaist if-then @if-then-else', async ({ I }) => {
I.waitForElement('.je-ready')

I.selectOption('[name="root[country]"]', 'America')
I.waitForElement('[name="root[postal_code]"]')
I.fillField('[name="root[postal_code]"]', 'K1M 1M4')
I.pressKey('Tab')
I.waitForElement('.invalid-feedback')
I.waitForText('Value must match the pattern [0-9]{5}(-[0-9]{4})?.')

I.selectOption('[name="root[country]"]', 'Canada')
I.waitForElement('[name="root[postal_code]"]')
I.fillField('[name="root[postal_code]"]', '10000')
I.pressKey('Tab')
I.dontSee('.invalid-feedback')

I.selectOption('[name="root[country]"]', 'America')
I.waitForElement('[name="root[postal_code]"]')
I.fillField('[name="root[postal_code]"]', '10000')
I.pressKey('Tab')
I.dontSee('.invalid-feedback')

I.selectOption('[name="root[country]"]', 'Canada')
I.waitForElement('[name="root[postal_code]"]')
I.fillField('[name="root[postal_code]"]', 'K1M 1M4')
I.pressKey('Tab')
I.dontSee('.invalid-feedback')
Expand All @@ -121,22 129,26 @@ Scenario('validate agaist if-else @if-then-else', async ({ I }) => {
I.waitForElement('.je-ready')

I.selectOption('[name="root[country]"]', 'America')
I.waitForElement('[name="root[postal_code]"]')
I.fillField('[name="root[postal_code]"]', 'K1M 1M4')
I.pressKey('Tab')
I.dontSee('.invalid-feedback')

I.selectOption('[name="root[country]"]', 'Canada')
I.waitForElement('[name="root[postal_code]"]')
I.fillField('[name="root[postal_code]"]', '10000')
I.pressKey('Tab')
I.waitForElement('.invalid-feedback')
I.waitForText('Value must match the pattern [A-Z][0-9][A-Z] [0-9][A-Z][0-9].')

I.selectOption('[name="root[country]"]', 'America')
I.waitForElement('[name="root[postal_code]"]')
I.fillField('[name="root[postal_code]"]', '10000')
I.pressKey('Tab')
I.dontSee('.invalid-feedback')

I.selectOption('[name="root[country]"]', 'Canada')
I.waitForElement('[name="root[postal_code]"]')
I.fillField('[name="root[postal_code]"]', 'K1M 1M4')
I.pressKey('Tab')
I.dontSee('.invalid-feedback')
Expand All @@ -147,23 159,27 @@ Scenario('validate agaist if-then-else when disabled fields are present in field
I.waitForElement('.je-ready')

I.selectOption('[name="root[country]"]', 'America')
I.waitForElement('[name="root[postal_code]"]')
I.fillField('[name="root[postal_code]"]', 'K1M 1M4')
I.pressKey('Tab')
I.waitForElement('.invalid-feedback')
I.waitForText('Value must match the pattern [0-9]{5}(-[0-9]{4})?.')

I.selectOption('[name="root[country]"]', 'Canada')
I.waitForElement('[name="root[postal_code]"]')
I.fillField('[name="root[postal_code]"]', '10000')
I.pressKey('Tab')
I.waitForElement('.invalid-feedback')
I.waitForText('Value must match the pattern [A-Z][0-9][A-Z] [0-9][A-Z][0-9].')

I.selectOption('[name="root[country]"]', 'America')
I.waitForElement('[name="root[postal_code]"]')
I.fillField('[name="root[postal_code]"]', '10000')
I.pressKey('Tab')
I.dontSee('.invalid-feedback')

I.selectOption('[name="root[country]"]', 'Canada')
I.waitForElement('[name="root[postal_code]"]')
I.fillField('[name="root[postal_code]"]', 'K1M 1M4')
I.pressKey('Tab')
I.dontSee('.invalid-feedback')
Expand Down

0 comments on commit 5ca0ae3

Please sign in to comment.