Skip to content

Commit

Permalink
Merge branch 'main' into dfe-frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
dneed-nimble authored Nov 23, 2023
2 parents eb9e7ad + 26594d0 commit 8dae321
Show file tree
Hide file tree
Showing 24 changed files with 3,891 additions and 12,155 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/continuous-integration-terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,19 @@ jobs:
run: rm ./terraform/backend.tf

- name: Run a Terraform init
uses: docker://hashicorp/terraform:1.6.3
uses: docker://hashicorp/terraform:1.6.4
with:
entrypoint: terraform
args: -chdir=terraform init

- name: Run a Terraform validate
uses: docker://hashicorp/terraform:1.6.3
uses: docker://hashicorp/terraform:1.6.4
with:
entrypoint: terraform
args: -chdir=terraform validate

- name: Run a Terraform format check
uses: docker://hashicorp/terraform:1.6.3
uses: docker://hashicorp/terraform:1.6.4
with:
entrypoint: terraform
args: -chdir=terraform fmt -check=true -diff=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@
"cypress/no-pause": "error"
},
"env": {
"cypress/globals": true
"cypress/globals": true,
"node": true
},
"extends": [
"plugin:cypress/recommended",
"eslint:recommended"
]
],
"parserOptions": {
"ecmaVersion": 2022
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/// <reference types ='Cypress'/>

import BasePage from "./BasePage";
import BasePage from "./BasePage"

const currentYear = new Date();
const nextYear = new Date().setFullYear(new Date().getFullYear() + 1);
const currentYear = new Date()
const nextYear = new Date().setFullYear(new Date().getFullYear() + 1)

export default class Budget extends BasePage {
static selectors = {
Expand All @@ -26,9 +26,9 @@ export default class Budget extends BasePage {
nextFinancialYearCapitalValue: '[id="finance-projected-capital"]',
saveButton: '[class="govuk-button"]',
completeCheckbox: '[id="school-budget-information-complete"]'
};
}

static path = 'budget';
static path = 'budget'

static updateBudgetInfomation({
endOfFinanicalYear,
Expand All @@ -39,68 +39,78 @@ export default class Budget extends BasePage {
forecastedCapitalNextYear
}) {
if (!endOfFinanicalYear) {
endOfFinanicalYear = currentYear;
endOfFinanicalYear = currentYear
}

if (!endOfNextFinancialYear) {
endOfNextFinancialYear = nextYear;
endOfNextFinancialYear = nextYear
}
cy.checkPath(this.path);
cy.checkPath(this.path)

cy.get(this.selectors.changeEndOfFinancialYearLink).click()

cy.get(this.selectors.currentFinancialYearDayInput).clear().type(endOfFinanicalYear.getDate());
cy.get(this.selectors.currentFinancialYearMonthInput).clear().type(endOfFinanicalYear.getMonth() + 1); // Add 1 as months start at 0
cy.get(this.selectors.currentFinancialYearYearInput).clear().type(endOfFinanicalYear.getFullYear());
cy.get(this.selectors.currentFinancialYearRevenueInput).clear().type(forecastedRevenueCurrentYear);
cy.get(this.selectors.currentFinancialYearCapitalInput).clear().type(forecastedCapitalCurrentYear);

cy.get(this.selectors.nextFinancialYearDayInput).clear().type(endOfNextFinancialYear.getDate());
cy.get(this.selectors.nextFinancialYearMonthInput).clear().type(endOfNextFinancialYear.getMonth() + 1); // Add 1 as months start at 0
cy.get(this.selectors.nextFinancialYearYearInput).clear().type(endOfNextFinancialYear.getFullYear());
cy.get(this.selectors.nextFinancialYearRevenueInput).clear().type(forecastedRevenueNextYear);
cy.get(this.selectors.nextFinancialYearCapitalInput).clear().type(forecastedCapitalNextYear);

cy.get(this.selectors.saveButton).click();
};
cy.get(this.selectors.currentFinancialYearDayInput).clear()
cy.get(this.selectors.currentFinancialYearDayInput).type(endOfFinanicalYear.getDate())
cy.get(this.selectors.currentFinancialYearMonthInput).clear()
cy.get(this.selectors.currentFinancialYearMonthInput).type(endOfFinanicalYear.getMonth() + 1) // Add 1 as months start at 0
cy.get(this.selectors.currentFinancialYearYearInput).clear()
cy.get(this.selectors.currentFinancialYearYearInput).type(endOfFinanicalYear.getFullYear())
cy.get(this.selectors.currentFinancialYearRevenueInput).clear()
cy.get(this.selectors.currentFinancialYearRevenueInput).type(forecastedRevenueCurrentYear)
cy.get(this.selectors.currentFinancialYearCapitalInput).clear()
cy.get(this.selectors.currentFinancialYearCapitalInput).type(forecastedCapitalCurrentYear)

cy.get(this.selectors.nextFinancialYearDayInput).clear()
cy.get(this.selectors.nextFinancialYearDayInput).type(endOfNextFinancialYear.getDate())
cy.get(this.selectors.nextFinancialYearMonthInput).clear()
cy.get(this.selectors.nextFinancialYearMonthInput).type(endOfNextFinancialYear.getMonth() + 1) // Add 1 as months start at 0
cy.get(this.selectors.nextFinancialYearYearInput).clear()
cy.get(this.selectors.nextFinancialYearYearInput).type(endOfNextFinancialYear.getFullYear())
cy.get(this.selectors.nextFinancialYearRevenueInput).clear()
cy.get(this.selectors.nextFinancialYearRevenueInput).type(forecastedRevenueNextYear)
cy.get(this.selectors.nextFinancialYearCapitalInput).clear()
cy.get(this.selectors.nextFinancialYearCapitalInput).type(forecastedCapitalNextYear)

cy.get(this.selectors.saveButton).click()
}

static getCurrentFinancialYear() {
cy.checkPath(this.path);
return cy.get(this.selectors.currentFinancialYearValue);
cy.checkPath(this.path)
return cy.get(this.selectors.currentFinancialYearValue)
}

static getCurrentRevenue() {
cy.checkPath(this.path);
return cy.get(this.selectors.currentFinancialYearRevenueValue);
cy.checkPath(this.path)
return cy.get(this.selectors.currentFinancialYearRevenueValue)
}

static getCurrentCapital() {
cy.checkPath(this.path);
cy.checkPath(this.path)
return cy.get(this.selectors.currentFinancialYearCapitalValue)
}

static getNextFinancialYear() {
cy.checkPath(this.path);
return cy.get(this.selectors.nextFinancialYearValue);
cy.checkPath(this.path)
return cy.get(this.selectors.nextFinancialYearValue)
}

static getNextRevenue() {
cy.checkPath(this.path);
return cy.get(this.selectors.nextFinancialYearRevenueValue);
cy.checkPath(this.path)
return cy.get(this.selectors.nextFinancialYearRevenueValue)
}

static getNextCapital() {
cy.checkPath(this.path);
return cy.get(this.selectors.nextFinancialYearCapitalValue);
cy.checkPath(this.path)
return cy.get(this.selectors.nextFinancialYearCapitalValue)
}

static markComplete() {
cy.checkPath(this.path);
cy.get(this.selectors.completeCheckbox).check();
cy.checkPath(this.path)
cy.get(this.selectors.completeCheckbox).check()
}

static markIncomplete() {
cy.checkPath(this.path);
cy.get(this.selectors.completeCheckbox).uncheck();
cy.checkPath(this.path)
cy.get(this.selectors.completeCheckbox).uncheck()
}
};
}
Loading

0 comments on commit 8dae321

Please sign in to comment.