Skip to content

Commit

Permalink
Merge branch 'feature/137597-word-doc-sponsored' of https://github.co…
Browse files Browse the repository at this point in the history
…m/DFE-Digital/a2b-internal into feature/137597-word-doc-sponsored
  • Loading branch information
dneed-nimble committed Sep 18, 2023
2 parents d3a28d9 + 0c96586 commit ef322e5
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
/// <reference types ='Cypress'/>
import projectList from '../../pages/projectList'
import voluntaryProjectTaskList from '../../pages/voluntaryProjectTaskList'

var projectName = 'Voluntary Cypress Project'

describe('Voluntary conversion', { tags: ['@dev', '@stage'] }, () => {
beforeEach(() => {
cy.callAcademisationApi('POST', `cypress-data/add-voluntary-project.cy`, "{}")
.then(() => {
cy.login({ titleFilter: 'Cypress Project' })
.then(() => {
cy.get('[id="school-name-0"]').click();
});
projectList.selectProject(projectName)
});
})

it('TC01: Voluntary conversion journey ', () => {
// Go wild Dan!
voluntaryProjectTaskList.voluntaryProjectElementsVisible()

})
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export default class BasePage {
static setDesktopViewport()
{
cy.viewport('macbook-13')
}

static setLargeDesktopViewport()
{
cy.viewport(1980, 1080)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

export const path = 'project-list';

class ProjectList {
import BasePage from './BasePage'

export default new class projectList extends BasePage {

checkProjectListPage() {
cy.url().should('include', path);
Expand All @@ -28,12 +30,19 @@ class ProjectList {
this.getNthProject().click();
}

selectProject(projectName = 'Gloucester school') {
selectProject(projectName = 'Gloucester School') {
this.filterProjectList(projectName);
this.selectFirstItem();
return cy.url().then(url => this.getIdFromUrl(url));
};

selectVoluntaryProject() {
cy.login({titleFilter: 'Voluntary Cypress Project'});
cy.get('[id="school-name-0"]').click();

return cy.url().then(url => this.getIdFromUrl(url));
};

getIdFromUrl(url) {
const urlSplit = url.toString().split('/');
for (let i = urlSplit.length - 1; i > 0; i--) {
Expand All @@ -44,6 +53,4 @@ class ProjectList {

return '';
};
};

export default new ProjectList();
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import BasePage from './BasePage'

export default class voluntaryProjectTaskList extends BasePage {


static voluntaryProjectElementsVisible()
{
var projectName = 'Voluntary Cypress Project'
var routeType = 'Voluntary conversion'
var projectOwner = ''
var projectStatus = 'Approved with Conditions'

// Check Header section of main Project Page
cy.get('h1[data-cy]').contains(projectName)
cy.get('p[class="govuk-body govuk-!-margin-bottom-1"]').contains('Route: ' + routeType)
cy.get('p[class="govuk-body govuk-!-margin-bottom-5"]').contains('Project owner: ' + projectOwner)
cy.get('.empty').contains('Empty')
cy.get('a[class="govuk-link govuk-!-padding-left-50"]').contains('Change')
cy.get('strong[class="govuk-tag govuk-tag--green"]').contains(projectStatus)

// Check Project Tabs Section of main Project Page
cy.get('ul').eq(0).find('li').should('have.length',4)

// Check Project details is default tab selected
cy.get('a[aria-Current="page"]').contains('Project details')


}
}

Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</p>

<p class="govuk-body">
We use cookies for the <a asp-page="@Links.ProjectList.Index.Page">conversions part of our Prepare conversions and transfers service.</a> We use them to make our service work and to collect information about how you use the service.
We use cookies for the <a class="govuk-link" asp-page="@Links.ProjectList.Index.Page">conversions part of our Prepare conversions and transfers service.</a> We use them to make our service work and to collect information about how you use the service.
</p>

<p class="govuk-body">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<p class="govuk-body">
We use cookies to
<a class="govuk-link" data-test="cookie-banner-link-1" asp-page="@Links.Public.CookiePreferences.Page">collect information</a>
about how you use the <a asp-page="@Links.ProjectList.Index.Page" data-test="cookie-banner-conversion-link">conversions part of our service.</a>
about how you use the <a class="govuk-link" asp-page="@Links.ProjectList.Index.Page" data-test="cookie-banner-conversion-link">conversions part of our service.</a>
</p>
<div>
<a role="button" draggable="false" data-test="cookie-banner-accept" class="govuk-button govuk-!-margin-bottom-2" asp-page="@Links.Public.CookiePreferences.Page" asp-route-consent="true" asp-route-returnUrl="@Context.Request.Path">
Expand Down

0 comments on commit ef322e5

Please sign in to comment.