Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Cruikshanks committed Apr 29, 2024
1 parent 085095f commit f6a8e2e
Show file tree
Hide file tree
Showing 13 changed files with 40 additions and 40 deletions.
4 changes: 2 additions & 2 deletions cypress/e2e/internal/billing/annual/cancel-existing.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('Cancel an existing annual bill run (internal)', () => {

// Bill runs
// click the Create a bill run button
cy.get('#main-content > a.govuk-button').contains('Create a bill run').click()
cy.get('.govuk-button').contains('Create a bill run').click()

// Which kind of bill run do you want to create?
// choose Annual and continue
Expand All @@ -52,7 +52,7 @@ describe('Cancel an existing annual bill run (internal)', () => {
// The bill run we created will be the top result. We expect it's status to be BUILDING. Building might take a few
// seconds though so to avoid the test failing we use our custom Cypress command to look for the status EMPTY, and
// if not found reload the page and try again. We then select it using the link on the date created
cy.reloadUntilTextFound('tr:nth-child(1) > td:nth-child(6) > .govuk-tag', 'Empty')
cy.reloadUntilTextFound('[data-test="bill-run-status-0"] > .govuk-tag', 'Empty')
cy.get('@formattedCurrentDate').then((formattedCurrentDate) => {
cy.get('tr:nth-child(1)')
.should('contain.text', formattedCurrentDate)
Expand Down
16 changes: 8 additions & 8 deletions cypress/e2e/internal/billing/annual/journey.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('Create and send annual bill run (internal)', () => {

// Bill runs
// click the Create a bill run button
cy.get('#main-content > a.govuk-button').contains('Create a bill run').click()
cy.get('.govuk-button').contains('Create a bill run').click()

// Which kind of bill run do you want to create?
// choose Annual and continue
Expand All @@ -49,7 +49,7 @@ describe('Create and send annual bill run (internal)', () => {
// The bill run we created will be the top result. We expect it's status to be BUILDING. Building might take a few
// seconds though so to avoid the test failing we use our custom Cypress command to look for the status READY, and
// if not found reload the page and try again. We then select it using the link on the date created
cy.reloadUntilTextFound('tr:nth-child(1) > td:nth-child(6) > .govuk-tag', 'Ready')
cy.reloadUntilTextFound('[data-test="bill-run-status-0"] > .govuk-tag', 'ready')
cy.get('@formattedCurrentDate').then((formattedCurrentDate) => {
cy.get('tr:nth-child(1)')
.should('contain.text', formattedCurrentDate)
Expand Down Expand Up @@ -96,12 +96,12 @@ describe('Create and send annual bill run (internal)', () => {
// Bill runs
// back on the bill runs page confirm our bill run is present and listed as SENT
cy.get('@formattedCurrentDate').then((formattedCurrentDate) => {
cy.get('#main-content > div:nth-child(5) > div > table > tbody > tr:nth-child(1)')
.should('contain.text', formattedCurrentDate)
.and('contain.text', 'Test Region')
.and('contain.text', 'Annual')
.and('contain.text', '2,171.00')
.and('contain.text', 'Sent')
cy.get('[data-test="date-created-0"] > .govuk-link').should('contain.text', formattedCurrentDate)
cy.get('[data-test="region-0"]').should('contain.text', 'Test Region')
cy.get('[data-test="bill-run-type-0"]').should('contain.text', 'Annual')
cy.get('[data-test="number-of-bills-0"]').should('contain.text', '4')
cy.get('[data-test="bill-run-total-0"]').should('contain.text', '2,171.00')
cy.get('[data-test="bill-run-status-0"] > .govuk-tag').should('contain.text', 'sent')
})
})
})
4 changes: 2 additions & 2 deletions cypress/e2e/internal/billing/annual/remove-licence.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('Remove bill from annual bill run (internal)', () => {

// Bill runs
// click the Create a bill run button
cy.get('#main-content > a.govuk-button').contains('Create a bill run').click()
cy.get('.govuk-button').contains('Create a bill run').click()

// Which kind of bill run do you want to create?
// choose Annual and continue
Expand All @@ -49,7 +49,7 @@ describe('Remove bill from annual bill run (internal)', () => {
// The bill run we created will be the top result. We expect it's status to be BUILDING. Building might take a few
// seconds though so to avoid the test failing we use our custom Cypress command to look for the status READY, and
// if not found reload the page and try again. We then select it using the link on the date created
cy.reloadUntilTextFound('tr:nth-child(1) > td:nth-child(6) > .govuk-tag', 'Ready')
cy.reloadUntilTextFound('[data-test="bill-run-status-0"] > .govuk-tag', 'ready')
cy.get('@formattedCurrentDate').then((formattedCurrentDate) => {
cy.get('tr:nth-child(1)')
.should('contain.text', formattedCurrentDate)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('Cancel existing supplementary bill runs (internal)', () => {

// Bill runs
// click the Create a bill run button
cy.get('#main-content > a.govuk-button').contains('Create a bill run').click()
cy.get('.govuk-button').contains('Create a bill run').click()

// Which kind of bill run do you want to create?
// choose Supplementary and continue
Expand All @@ -55,7 +55,7 @@ describe('Cancel existing supplementary bill runs (internal)', () => {
// The bill run we created will be the top result. We expect it's status to be BUILDING. Building might take a few
// seconds though so to avoid the test failing we use our custom Cypress command to look for the status READY, and
// if not found reload the page and try again. We then select it using the link on the date created
cy.reloadUntilTextFound('tr:nth-child(1) > td:nth-child(6) > .govuk-tag', 'Ready')
cy.reloadUntilTextFound('[data-test="bill-run-status-0"] > .govuk-tag', 'ready')
cy.get('@formattedCurrentDate').then((formattedCurrentDate) => {
cy.get('tr:nth-child(1)')
.should('contain.text', formattedCurrentDate)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('Change billing account in current financial year (internal)', () => {

// Bill runs
// click the Create a bill run button
cy.get('#main-content > a.govuk-button').contains('Create a bill run').click()
cy.get('.govuk-button').contains('Create a bill run').click()

// Which kind of bill run do you want to create?
// choose Supplementary and continue
Expand Down Expand Up @@ -208,7 +208,7 @@ describe('Change billing account in current financial year (internal)', () => {

// Bill runs
// click the Create a bill run button
cy.get('#main-content > a.govuk-button').contains('Create a bill run').click()
cy.get('.govuk-button').contains('Create a bill run').click()

// Which kind of bill run do you want to create?
// choose Supplementary and continue
Expand All @@ -231,7 +231,7 @@ describe('Change billing account in current financial year (internal)', () => {
// The bill run we created will be the top result. We expect it's status to be BUILDING. Building might take a few
// seconds though so to avoid the test failing we use our custom Cypress command to look for the status READY, and
// if not found reload the page and try again. We then select it using the link on the date created
cy.reloadUntilTextFound('tr:nth-child(1) > td:nth-child(6) > .govuk-tag', 'Ready')
cy.reloadUntilTextFound('[data-test="bill-run-status-0"] > .govuk-tag', 'ready')
cy.get('@formattedCurrentDate').then((formattedCurrentDate) => {
cy.get('tr:nth-child(1)')
.should('contain.text', formattedCurrentDate)
Expand Down Expand Up @@ -293,7 +293,7 @@ describe('Change billing account in current financial year (internal)', () => {
// Bill runs
// back on the bill runs page confirm our SROC bill run is present and listed as SENT
cy.get('@formattedCurrentDate').then((formattedCurrentDate) => {
cy.get('#main-content > div:nth-child(5) > div > table > tbody > tr:nth-child(1)')
cy.get('table > tbody > tr:nth-child(1)')
.should('contain.text', formattedCurrentDate)
.and('contain.text', 'Test Region')
.and('contain.text', 'Supplementary')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('Change billing account in previous financial year (internal)', () => {

// Bill runs
// click the Create a bill run button
cy.get('#main-content > a.govuk-button').contains('Create a bill run').click()
cy.get('.govuk-button').contains('Create a bill run').click()

// Which kind of bill run do you want to create?
// choose Supplementary and continue
Expand Down Expand Up @@ -208,7 +208,7 @@ describe('Change billing account in previous financial year (internal)', () => {

// Bill runs
// click the Create a bill run button
cy.get('#main-content > a.govuk-button').contains('Create a bill run').click()
cy.get('.govuk-button').contains('Create a bill run').click()

// Which kind of bill run do you want to create?
// choose Supplementary and continue
Expand All @@ -231,7 +231,7 @@ describe('Change billing account in previous financial year (internal)', () => {
// The bill run we created will be the top result. We expect it's status to be BUILDING. Building might take a few
// seconds though so to avoid the test failing we use our custom Cypress command to look for the status READY, and
// if not found reload the page and try again. We then select it using the link on the date created
cy.reloadUntilTextFound('tr:nth-child(1) > td:nth-child(6) > .govuk-tag', 'Ready')
cy.reloadUntilTextFound('[data-test="bill-run-status-0"] > .govuk-tag', 'ready')
cy.get('@formattedCurrentDate').then((formattedCurrentDate) => {
cy.get('tr:nth-child(1)')
.should('contain.text', formattedCurrentDate)
Expand Down Expand Up @@ -302,7 +302,7 @@ describe('Change billing account in previous financial year (internal)', () => {
// Bill runs
// back on the bill runs page confirm our SROC bill run is present and listed as SENT
cy.get('@formattedCurrentDate').then((formattedCurrentDate) => {
cy.get('#main-content > div:nth-child(5) > div > table > tbody > tr:nth-child(1)')
cy.get('table > tbody > tr:nth-child(1)')
.should('contain.text', formattedCurrentDate)
.and('contain.text', 'Test Region')
.and('contain.text', 'Supplementary')
Expand Down
6 changes: 3 additions & 3 deletions cypress/e2e/internal/billing/supplementary/journey.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('Create and send supplementary bill runs (internal)', () => {

// Bill runs
// click the Create a bill run button
cy.get('#main-content > a.govuk-button').contains('Create a bill run').click()
cy.get('.govuk-button').contains('Create a bill run').click()

// Which kind of bill run do you want to create?
// choose Supplementary and continue
Expand All @@ -59,7 +59,7 @@ describe('Create and send supplementary bill runs (internal)', () => {
// The bill run we created will be the top result. We expect it's status to be BUILDING. Building might take a few
// seconds though so to avoid the test failing we use our custom Cypress command to look for the status READY, and
// if not found reload the page and try again. We then select it using the link on the date created
cy.reloadUntilTextFound('tr:nth-child(1) > td:nth-child(6) > .govuk-tag', 'Ready')
cy.reloadUntilTextFound('[data-test="bill-run-status-0"] > .govuk-tag', 'ready')
cy.get('@formattedCurrentDate').then((formattedCurrentDate) => {
cy.get('tr:nth-child(1)')
.should('contain.text', formattedCurrentDate)
Expand Down Expand Up @@ -108,7 +108,7 @@ describe('Create and send supplementary bill runs (internal)', () => {
// Bill runs
// back on the bill runs page confirm our PRESROC bill run is present and listed as SENT
cy.get('@formattedCurrentDate').then((formattedCurrentDate) => {
cy.get('#main-content > div:nth-child(5) > div > table > tbody > tr:nth-child(1)')
cy.get('table > tbody > tr:nth-child(1)')
.should('contain.text', formattedCurrentDate)
.and('contain.text', 'Old charge scheme')
.and('contain.text', 'Test Region')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('Create and send supplementary bill runs (internal)', () => {

// Bill runs
// click the Create a bill run button
cy.get('#main-content > a.govuk-button').contains('Create a bill run').click()
cy.get('.govuk-button').contains('Create a bill run').click()

// Which kind of bill run do you want to create?
// choose Supplementary and continue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('Make licence non-chargeable then see credit in next bill run (internal

// Bill runs
// click the Create a bill run button
cy.get('#main-content > a.govuk-button').contains('Create a bill run').click()
cy.get('.govuk-button').contains('Create a bill run').click()

// Which kind of bill run do you want to create?
// choose Supplementary and continue
Expand Down Expand Up @@ -161,7 +161,7 @@ describe('Make licence non-chargeable then see credit in next bill run (internal

// Bill runs
// click the Create a bill run button
cy.get('#main-content > a.govuk-button').contains('Create a bill run').click()
cy.get('.govuk-button').contains('Create a bill run').click()

// Which kind of bill run do you want to create?
// choose Supplementary and continue
Expand All @@ -178,7 +178,7 @@ describe('Make licence non-chargeable then see credit in next bill run (internal
// The bill run we created will be the top result. We expect it's status to be BUILDING. Building might take a few
// seconds though so to avoid the test failing we use our custom Cypress command to look for the status READY, and
// if not found reload the page and try again. We then select it using the link on the date created
cy.reloadUntilTextFound('tr:nth-child(1) > td:nth-child(6) > .govuk-tag', 'Ready')
cy.reloadUntilTextFound('[data-test="bill-run-status-0"] > .govuk-tag', 'ready')
cy.get('@formattedCurrentDate').then((formattedCurrentDate) => {
cy.get('tr:nth-child(1)')
.should('contain.text', formattedCurrentDate)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ describe('Replace charge version in the 2023 financial year with no changes (int

// Bill runs
// click the Create a bill run button
cy.get('#main-content > a.govuk-button').contains('Create a bill run').click()
cy.get('.govuk-button').contains('Create a bill run').click()

// Which kind of bill run do you want to create?
// choose Supplementary and continue
Expand Down Expand Up @@ -263,7 +263,7 @@ describe('Replace charge version in the 2023 financial year with no changes (int

// Bill runs
// click the Create a bill run button
cy.get('#main-content > a.govuk-button').contains('Create a bill run').click()
cy.get('.govuk-button').contains('Create a bill run').click()

// Which kind of bill run do you want to create?
// choose Supplementary and continue
Expand All @@ -283,7 +283,7 @@ describe('Replace charge version in the 2023 financial year with no changes (int
// The bill run we created will be the top result. We expect it's status to be BUILDING. Building might take a few
// seconds though so to avoid the test failing we use our custom Cypress command to look for the status READY, and
// if not found reload the page and try again. We then select it using the link on the date created
cy.reloadUntilTextFound('tr:nth-child(1) > td:nth-child(6) > .govuk-tag', 'Ready')
cy.reloadUntilTextFound('[data-test="bill-run-status-0"] > .govuk-tag', 'ready')
cy.get('@formattedCurrentDate').then((formattedCurrentDate) => {
cy.get('tr:nth-child(1)')
.should('contain.text', formattedCurrentDate)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ describe('Replace charge version in current financial year change the charge ref

// Bill runs
// click the Create a bill run button
cy.get('#main-content > a.govuk-button').contains('Create a bill run').click()
cy.get('.govuk-button').contains('Create a bill run').click()

// Which kind of bill run do you want to create?
// choose Supplementary and continue
Expand Down Expand Up @@ -312,7 +312,7 @@ describe('Replace charge version in current financial year change the charge ref

// Bill runs
// click the Create a bill run button
cy.get('#main-content > a.govuk-button').contains('Create a bill run').click()
cy.get('.govuk-button').contains('Create a bill run').click()

// Which kind of bill run do you want to create?
// choose Supplementary and continue
Expand All @@ -332,7 +332,7 @@ describe('Replace charge version in current financial year change the charge ref
// The bill run we created will be the top result. We expect it's status to be BUILDING. Building might take a few
// seconds though so to avoid the test failing we use our custom Cypress command to look for the status READY, and
// if not found reload the page and try again. We then select it using the link on the date created
cy.reloadUntilTextFound('tr:nth-child(1) > td:nth-child(6) > .govuk-tag', 'Ready')
cy.reloadUntilTextFound('[data-test="bill-run-status-0"] > .govuk-tag', 'ready')
cy.get('@formattedCurrentDate').then((formattedCurrentDate) => {
cy.get('tr:nth-child(1)')
.should('contain.text', formattedCurrentDate)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('Cancel an existing two-part tariff bill run (internal)', () => {

// Bill runs
// click the Create a bill run button
cy.get('#main-content > a.govuk-button').contains('Create a bill run').click()
cy.get('.govuk-button').contains('Create a bill run').click()

// Which kind of bill run do you want to create?
// choose Two-part tariff then continue
Expand All @@ -59,7 +59,7 @@ describe('Cancel an existing two-part tariff bill run (internal)', () => {
// The bill run we created will be the top result. We expect it's status to be BUILDING. Building might take a few
// seconds though so to avoid the test failing we use our custom Cypress command to look for the status EMPTY, and
// if not found reload the page and try again. We then select it using the link on the date created
cy.reloadUntilTextFound('tr:nth-child(1) > td:nth-child(6) > .govuk-tag', 'Empty')
cy.reloadUntilTextFound('[data-test="bill-run-status-0"] > .govuk-tag', 'Empty')
cy.get('@formattedCurrentDate').then((formattedCurrentDate) => {
cy.get('tr:nth-child(1)')
.should('contain.text', formattedCurrentDate)
Expand Down
6 changes: 3 additions & 3 deletions cypress/e2e/internal/billing/two-part-tariff/journey.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('Create and send PRESROC two-part tariff bill run (internal)', () => {

// Bill runs
// click the Create a bill run button
cy.get('#main-content > a.govuk-button').contains('Create a bill run').click()
cy.get('.govuk-button').contains('Create a bill run').click()

// Which kind of bill run do you want to create?
// choose Two-part tariff then continue
Expand All @@ -59,7 +59,7 @@ describe('Create and send PRESROC two-part tariff bill run (internal)', () => {
// The bill run we created will be the top result. We expect it's status to be BUILDING. Building might take a few
// seconds though so to avoid the test failing we use our custom Cypress command to look for the status REVIEW, and
// if not found reload the page and try again. We then select it using the link on the date created
cy.reloadUntilTextFound('tr:nth-child(1) > td:nth-child(6) > .govuk-tag', 'Review')
cy.reloadUntilTextFound('[data-test="bill-run-status-0"] > .govuk-tag', 'Review')
cy.get('@formattedCurrentDate').then((formattedCurrentDate) => {
cy.get('tr:nth-child(1)')
.should('contain.text', formattedCurrentDate)
Expand Down Expand Up @@ -158,7 +158,7 @@ describe('Create and send PRESROC two-part tariff bill run (internal)', () => {
// Bill runs
// back on the bill runs page confirm our PRESROC bill run is present and listed as SENT
cy.get('@formattedCurrentDate').then((formattedCurrentDate) => {
cy.get('#main-content > div:nth-child(5) > div > table > tbody > tr:nth-child(1)')
cy.get('table > tbody > tr:nth-child(1)')
.should('contain.text', formattedCurrentDate)
.and('contain.text', 'Old charge scheme')
.and('contain.text', 'Test Region')
Expand Down

0 comments on commit f6a8e2e

Please sign in to comment.