-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eaa830a
commit 825cfae
Showing
10 changed files
with
111 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
value: value, | ||
items: [ | ||
{ | ||
id: "email", | ||
id: "receiveMethod", | ||
value: "email", | ||
text: "Email" | ||
}, | ||
|
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
50 changes: 50 additions & 0 deletions
50
user-journey-tests/page-objects/receiving-the-licence/receiveMethodPage.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,50 @@ | ||
import { Page } from '../page.js' | ||
|
||
const emailId = 'receiveMethod' | ||
const postId = 'post' | ||
const pageHeadingAndTitle = 'How would you like this licence sent to you?' | ||
|
||
class ReceiveMethodPage extends Page { | ||
pagePath = '/receiving-the-licence/licence-email-or-post' | ||
pageHeading = pageHeadingAndTitle | ||
pageTitle = pageHeadingAndTitle | ||
noSelectionError = 'Select how you would like this licence sent to you' | ||
|
||
get emailRadio() { | ||
return super.getInputField(emailId) | ||
} | ||
|
||
get postRadio() { | ||
return super.getInputField(postId) | ||
} | ||
|
||
get receiveMethodRadioError() { | ||
return super.getErrorElement(emailId) | ||
} | ||
|
||
get receiveMethodSummaryErrorLink() { | ||
return super.getErrorLink(emailId) | ||
} | ||
|
||
async selectEmailAndContinue() { | ||
await super.selectRadioAndContinue(this.emailRadio) | ||
} | ||
|
||
async selectPostAndContinue() { | ||
await super.selectRadioAndContinue(this.postRadio) | ||
} | ||
|
||
async receiveMethodErrorTest() { | ||
await super.selectContinue() | ||
await super.verifyErrorsOnPage( | ||
this.receiveMethodRadioError, | ||
this.noSelectionError | ||
) | ||
await super.verifySummaryErrorLink( | ||
this.receiveMethodSummaryErrorLink, | ||
this.emailRadio | ||
) | ||
} | ||
} | ||
|
||
export default new ReceiveMethodPage() |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
import { browser } from '@wdio/globals' | ||
|
||
import { waitForPagePath } from '../../helpers/page.js' | ||
import emailPage from '../../page-objects/receiving-the-licence/emailPage.js' | ||
import licenceAnswersPage from '../../page-objects/receiving-the-licence/licenceAnswersPage.js' | ||
|
||
const validSubmissionCheck = async (input, whitespace = false) => { | ||
let expected | ||
|
@@ -56,8 +54,6 @@ describe('Email address for licence page test', () => { | |
await emailPage.inputEmailAndContinue('[email protected]') | ||
await expect(emailPage.emailFieldError()).not.toBeDisplayed() | ||
await expect(emailPage.errorSummary).not.toBeDisplayed() | ||
|
||
await waitForPagePath(licenceAnswersPage.pagePath) | ||
}) | ||
|
||
it.skip('Should check answer is maintained when submitting after an error', async () => { | ||
|
28 changes: 28 additions & 0 deletions
28
user-journey-tests/specs/receiving-the-licence/receiveMethod.spec.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,28 @@ | ||
import { browser } from '@wdio/globals' | ||
import receiveMethodPage from '../../page-objects/receiving-the-licence/receiveMethodPage.js' | ||
import emailPage from '../../page-objects/receiving-the-licence/emailPage.js' | ||
|
||
describe('Receive method for licence page test', () => { | ||
beforeEach('Reset browser state and navigate to page', async () => { | ||
await browser.reloadSession() | ||
await receiveMethodPage.navigateToPageAndVerifyTitle() | ||
}) | ||
|
||
it('Should verify that the page errors when no option is selected', async () => { | ||
await receiveMethodPage.receiveMethodErrorTest() | ||
}) | ||
|
||
it('Should select email and continue', async () => { | ||
await receiveMethodPage.selectEmailAndContinue() | ||
await expect(receiveMethodPage.pageError).not.toBeDisplayed() | ||
await expect(receiveMethodPage.errorSummary).not.toBeDisplayed() | ||
await emailPage.verifyPageHeadingAndTitle() | ||
}) | ||
|
||
it('Should choose an option and check its maintained', async () => { | ||
await receiveMethodPage.selectEmailAndContinue() | ||
await emailPage.verifyPageHeadingAndTitle() | ||
await browser.back() | ||
await expect(receiveMethodPage.emailRadio).toBeSelected() | ||
}) | ||
}) |
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