-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(EMS-2656): iterations - E2E - text and value cypress command (#…
- Loading branch information
Showing
12 changed files
with
117 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
e2e-tests/commands/shared-commands/assertions/assert-name-email-and-position-fields.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { field } from '../../../pages/shared'; | ||
import { INSURANCE_FIELD_IDS } from '../../../constants/field-ids/insurance'; | ||
|
||
const { | ||
POLICY: { | ||
DIFFERENT_NAME_ON_POLICY: { POSITION }, | ||
}, | ||
ACCOUNT: { FIRST_NAME, LAST_NAME, EMAIL }, | ||
} = INSURANCE_FIELD_IDS; | ||
|
||
/** | ||
* assertNameEmailAndPositionFields | ||
* Asserts FIRST_NAME, LAST_NAME, EMAIL and POSITION fields' values. | ||
* @param {String} expectedFirstName: First name | ||
* @param {String} expectedLastName: Last name | ||
* @param {String} expectedEmail: Email address | ||
* @param {String} expectedPosition: Position | ||
*/ | ||
const assertNameEmailAndPositionFields = ({ expectedFirstName, expectedLastName, expectedEmail, expectedPosition }) => { | ||
cy.checkValue(field(FIRST_NAME), expectedFirstName); | ||
cy.checkValue(field(LAST_NAME), expectedLastName); | ||
cy.checkValue(field(EMAIL), expectedEmail); | ||
cy.checkValue(field(POSITION), expectedPosition); | ||
}; | ||
|
||
export default assertNameEmailAndPositionFields; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
e2e-tests/commands/shared-commands/assertions/check-text-and-value.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** | ||
* checkTextAndValue | ||
* Check the text and value of an element | ||
* @param {Function} textSelector: Cypress selector for text | ||
* @param {String} expectedText: Expected text | ||
* @param {Function} selector: Cypress selector for value | ||
* @param {String} expectedValue: Expected value | ||
*/ | ||
const checkTextAndValue = ({ textSelector, expectedText, valueSelector, expectedValue }) => { | ||
cy.checkText(textSelector, expectedText); | ||
cy.checkValue(valueSelector, expectedValue); | ||
}; | ||
|
||
export default checkTextAndValue; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters