-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #968 from DFE-Digital/tests/247109/fix-dpv-bugs
tests(247109): fix dpv bugs
- Loading branch information
Showing
31 changed files
with
243 additions
and
121 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
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
10 changes: 6 additions & 4 deletions
10
tests/Dfe.PlanTech.Web.E2ETests/cypress/commands/section-status-check.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
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
26 changes: 12 additions & 14 deletions
26
...fe.PlanTech.Web.E2ETests/cypress/e2e/dynamic-page-validator/validators/completion-tags.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 |
---|---|---|
@@ -1,37 +1,35 @@ | ||
import { CleanText, getSubmissionTimeText } from "../helpers/index.js"; | ||
import { CleanText, getSubmissionTimeText, viewRecommendationButtonText, newTagText } from "../helpers/index.js"; | ||
|
||
export const validateCompletionTags = (section, introPage) => { | ||
export const validateCompletionTags = (section) => { | ||
const time = new Date(); | ||
const timePlusOneMinute = new Date(time).setMinutes(time.getMinutes() + 1); | ||
const timeMinusOneMinute = new Date(time).setMinutes(time.getMinutes() - 1); | ||
const lateTime = new Date(timePlusOneMinute); | ||
const earlyTime = new Date(timeMinusOneMinute) | ||
|
||
|
||
const expectedPath = | ||
`/${section.name.trim()}/recommendation/${introPage.slug.trim()}` | ||
.toLowerCase() | ||
.replace(/ /g, "-"); | ||
|
||
cy.get("a.govuk-link") | ||
.contains(section.name.trim()) | ||
.should("have.attr", "href").and("include", `${section.name.trim().toLowerCase().replace(/ /g, "-")}`); | ||
|
||
cy.get("a.govuk-link") | ||
.contains(section.name.trim()) | ||
const sectionSlug = section.interstitialPage.fields.slug; | ||
cy.findSectionLink(section.name, sectionSlug) | ||
.parent() | ||
.next() | ||
.within(() => { | ||
cy.get("strong.app-task-list__tag").invoke("text") | ||
.then((text) => { | ||
cy.wrap(CleanText(text)).should("be.oneOf", [ getSubmissionTimeText(time), getSubmissionTimeText(lateTime) ]); | ||
cy.wrap(CleanText(text)).should("be.oneOf", [ getSubmissionTimeText(time), getSubmissionTimeText(lateTime), getSubmissionTimeText(earlyTime) ]); | ||
}); | ||
}) | ||
|
||
cy.get("a.govuk-link") | ||
.contains(section.name.trim()) | ||
|
||
cy.findSectionLink(section.name, sectionSlug) | ||
.parent().next().next() | ||
.within(() => { | ||
cy.get("strong.app-task-list__tag").should("include.text", "New").and("have.class", "govuk-tag--yellow"); | ||
cy.get("a.govuk-button").contains("View recommendation") | ||
cy.get("strong.app-task-list__tag").should("include.text", newTagText).and("have.class", "govuk-tag--yellow"); | ||
cy.get("a.govuk-button").contains(viewRecommendationButtonText) | ||
.should("have.attr", "href") | ||
.and("include", expectedPath); | ||
}) | ||
} |
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
4 changes: 2 additions & 2 deletions
4
...Dfe.PlanTech.Web.E2ETests/cypress/e2e/dynamic-page-validator/validators/non-auth-pages.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
10 changes: 5 additions & 5 deletions
10
...anTech.Web.E2ETests/cypress/e2e/dynamic-page-validator/validators/recommendation-intro.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
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
Oops, something went wrong.