Skip to content

Commit

Permalink
Merge pull request #642 from DFE-Digital/test-unskip-cypress-tests
Browse files Browse the repository at this point in the history
Test unskip cypress tests
  • Loading branch information
dangood84 authored Feb 5, 2025
2 parents 8f51cbe + 3f94755 commit 5e69cb3
Show file tree
Hide file tree
Showing 28 changed files with 41 additions and 917 deletions.
19 changes: 6 additions & 13 deletions CypressTests/cypress/e2e/FAM-AddTrustKeyPerson.cy.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
import { AuthorisedUserCanCreateNewFAMTrustKeyPersonBodyPayload } from '../fixtures/payloads/FAM-TrustKeyPerson/AuthorisedUserCanCreateNewFAMTrustKeyPerson.spec'
import { AuthorisedUserCanUpdateNewFAMTrustKeyPersonBodyPayload } from '../fixtures/payloads/FAM-TrustKeyPerson/AuthorisedUserCanUpdateNewFAMTrustKeyPerson.spec'
import { AuthorisedUserCannotCreateNewFAMTrustKeyPersonWITHINVALIDDOBBodyPayload } from '../fixtures/payloads/FAM-TrustKeyPerson/AuthorisedUserCannotCreateNewFAMTrustKeyPersonWITHINVALIDDOB.spec'
import { UnauthorisedUserCannotUpdateNewFAMTrustKeyPersonBodyPayload } from '../fixtures/payloads/FAM-TrustKeyPerson/UnauthorisedUserCannotUpdateNewFAMTrustKeyPerson.spec'
import { AuthorisedUserCanCreateNewFAMTrustKeyPersonBodyPayload } from '../fixtures/payloads/FAM-TrustKeyPerson/AuthorisedUserCanCreateNewFAMTrustKeyPerson'
import { AuthorisedUserCanUpdateNewFAMTrustKeyPersonBodyPayload } from '../fixtures/payloads/FAM-TrustKeyPerson/AuthorisedUserCanUpdateNewFAMTrustKeyPerson'
import { AuthorisedUserCannotCreateNewFAMTrustKeyPersonWITHINVALIDDOBBodyPayload } from '../fixtures/payloads/FAM-TrustKeyPerson/AuthorisedUserCannotCreateNewFAMTrustKeyPersonWITHINVALIDDOB'
import { UnauthorisedUserCannotUpdateNewFAMTrustKeyPersonBodyPayload } from '../fixtures/payloads/FAM-TrustKeyPerson/UnauthorisedUserCannotUpdateNewFAMTrustKeyPerson'

describe.skip('Academisation API Testing - FAM - Add Trust Key Person', () => {
describe('Academisation API Testing - FAM - Add Trust Key Person', () => {
let apiKey = Cypress.env('apiKey')
let url = Cypress.env('url')
let applicationNumber = 10038
let applicationNumber = url.includes('test') ? 10491 : 10038;
let trustKeyPersonNumber = 0

it('POST - Verify An UnAuthorised User Is Unable To Create New FAM-Trust Key Person - Form-Trust Key-Person - 401 UNAUTHORISED Expected', function () {
cy.skipWhen(url.includes('d01'), this)

cy.api({
method: 'POST',
url: url + '/application/' + applicationNumber + '/form-trust/key-person',
Expand Down Expand Up @@ -59,8 +57,6 @@ describe.skip('Academisation API Testing - FAM - Add Trust Key Person', () => {
})

it('GET - Verify An UNAuthorised User Is UNAble To GET FAM-Trust Key PERSONS - Form-Trust Key-PersonS - 401 UNAUTHORISED Expected', function () {
cy.skipWhen(url.includes('d01'), this)

cy.api({
method: 'GET',
url: url + '/application/' + applicationNumber + '/form-trust/key-person',
Expand Down Expand Up @@ -90,8 +86,6 @@ describe.skip('Academisation API Testing - FAM - Add Trust Key Person', () => {
})

it('GET - Verify An UNAuthorised User Is UNAble To GET FAM-Trust Key Person - Form-Trust Key-Person - 401 UNAUTHORISED Expected', function () {
cy.skipWhen(url.includes('d01'), this)

cy.api({
method: 'GET',
url: url + '/application/' + applicationNumber + '/form-trust/key-person' + '/' + 105,
Expand Down Expand Up @@ -120,7 +114,6 @@ describe.skip('Academisation API Testing - FAM - Add Trust Key Person', () => {
})

it('PUT - Verify An UNAuthorised User Is UNAble To UPDATE a FAM-Trust Key Person - Form-Trust Key-Person - 401 UNAUTHORISED Expected', function () {
cy.skipWhen(url.includes('d01'), this)

cy.log(JSON.stringify('Id = ' + Cypress.env('responseIDForRequest')))
cy.api({
Expand Down
30 changes: 13 additions & 17 deletions CypressTests/cypress/e2e/Get-UpdateApplication.cy.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { UnauthorisedUserCannotUpdatePayload } from '../fixtures/payloads/UnauthorisedUserCannotUpdateBody.spec'
import { AuthorisedUserCanUpdatePayload } from '../fixtures/payloads/AuthorisedUserCanUpdate.spec'
import { AuthorisedUserCannotUpdateTheirContributorsEmailToAnotherEmailBodyPayload } from '../fixtures/payloads/AuthorisedUserCannotChangeTheirContributorsEmailToAnotherEmail.spec'
import { AuthorisedUserCannotUpdateTheirContributorsEmailToInvalidEmailBodyPayload } from '../fixtures/payloads/AuthorisedUserCannotChangeTheirContributorsEmailToInvalidEmail.spec'
import { AuthorisedUserCannotUpdateWorksPlannedDateToInvalidDateBodyPayload } from '../fixtures/payloads/AuthorisedUserCannotChangeWorksPlannedDateToInvalidDate.spec'
import { AuthorisedUserCannotUpdateSacreExemptionEndDateToInvalidDateBodyPayload } from '../fixtures/payloads/AuthorisedUserCannotChangeSacreExemptionEndDateToInvalidDate.spec'
import { AuthorisedUserCannotUpdateSchoolConversionTargetDateToInvalidDateBodyPayload } from '../fixtures/payloads/AuthorisedUserCannotUpdateSchoolConversionTargetDateToInvalidDateBody.spec'
import { AuthorisedUserCannotUpdatePreviousFinancialYearEndDateToInvalidDateBodyPayload } from '../fixtures/payloads/AuthorisedUserCannotChangePreviousFinancialYearEndDateToInvalidDate.spec'
import { AuthorisedUserCannotUpdateCurrentFinancialYearEndDateToInvalidDateBodyPayload } from '../fixtures/payloads/AuthorisedUserCannotChangeCurrentFinancialYearEndDateToInvalidDate.spec'
import { AuthorisedUserCannotUpdateNextFinancialYearEndDateToInvalidDateBodyPayload } from '../fixtures/payloads/AuthorisedUserCannotChangeNextFinancialYearEndDateToInvalidDate.spec'

describe.skip('Academisation API Testing', () => {
import { UnauthorisedUserCannotUpdatePayload } from '../fixtures/payloads/UnauthorisedUserCannotUpdateBody'
import { AuthorisedUserCanUpdatePayload } from '../fixtures/payloads/AuthorisedUserCanUpdate'
import { AuthorisedUserCannotUpdateTheirContributorsEmailToAnotherEmailBodyPayload } from '../fixtures/payloads/AuthorisedUserCannotChangeTheirContributorsEmailToAnotherEmail'
import { AuthorisedUserCannotUpdateTheirContributorsEmailToInvalidEmailBodyPayload } from '../fixtures/payloads/AuthorisedUserCannotChangeTheirContributorsEmailToInvalidEmail'
import { AuthorisedUserCannotUpdateWorksPlannedDateToInvalidDateBodyPayload } from '../fixtures/payloads/AuthorisedUserCannotChangeWorksPlannedDateToInvalidDate'
import { AuthorisedUserCannotUpdateSacreExemptionEndDateToInvalidDateBodyPayload } from '../fixtures/payloads/AuthorisedUserCannotChangeSacreExemptionEndDateToInvalidDate'
import { AuthorisedUserCannotUpdateSchoolConversionTargetDateToInvalidDateBodyPayload } from '../fixtures/payloads/AuthorisedUserCannotUpdateSchoolConversionTargetDateToInvalidDateBody'
import { AuthorisedUserCannotUpdatePreviousFinancialYearEndDateToInvalidDateBodyPayload } from '../fixtures/payloads/AuthorisedUserCannotChangePreviousFinancialYearEndDateToInvalidDate'
import { AuthorisedUserCannotUpdateCurrentFinancialYearEndDateToInvalidDateBodyPayload } from '../fixtures/payloads/AuthorisedUserCannotChangeCurrentFinancialYearEndDateToInvalidDate'
import { AuthorisedUserCannotUpdateNextFinancialYearEndDateToInvalidDateBodyPayload } from '../fixtures/payloads/AuthorisedUserCannotChangeNextFinancialYearEndDateToInvalidDate'

describe('Academisation API Testing', () => {
let apiKey = Cypress.env('apiKey')
let url = Cypress.env('url')
let applicationNumber = 10002
let applicationNumber = url.includes('test') ? 281 : 10002;
let emailRegex = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/
let getDateTimestampFormatRegex = /^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2})Z?$/

Expand Down Expand Up @@ -66,8 +66,6 @@ describe.skip('Academisation API Testing', () => {
})

it('GET - Verify An UNAUTHORISED USER CANNOT Retreive An Application - 401 UNAUTHORISED EXPECTED', function () {
cy.skipWhen(url.includes('d01'), this)

cy.api({
method: 'GET',
url: url + '/application/' + applicationNumber,
Expand Down Expand Up @@ -222,8 +220,6 @@ describe.skip('Academisation API Testing', () => {
})

it('PUT - Verify An UNAUTHORISED USER CANNOT Update An Application - 401 UNAUTHORISED EXPECTED', function () {
cy.skipWhen(url.includes('d01'), this)

cy.api({
method: 'PUT',
url: url + '/application/' + applicationNumber,
Expand Down
Loading

0 comments on commit 5e69cb3

Please sign in to comment.