Skip to content
Snippets Groups Projects
Commit d40a9196 authored by André Angelantoni's avatar André Angelantoni
Browse files

Add 403 test.

parent 6791f807
No related branches found
No related tags found
No related merge requests found
Automated Testing Kit 1.0.0-beta5, 2023-07-18
---------------------------------------------
Changes since 1.0.0-beta4:
- Added 403 error page test (ATK-CY-1060, ATK-PW-1060) and documentation.
Automated Testing Kit 1.0.0-beta4, 2023-07-14
---------------------------------------------
Changes since 1.0.0-beta3:
- Added 404 error page test (ATK-CY-1060, ATK-PW-1060) and documentation.
- Added 404 error page test (ATK-CY-1061, ATK-PW-1061) and documentation.
- Added @ to Cypress tags; added @alters-db where needed.
Automated Testing Kit 1.0.0-beta3, 2023-07-06
......
......@@ -26,31 +26,48 @@ import qaUserAccounts from '../../data/qaUsers.json'
describe('Page error tests.', () => {
//
// Validate 404 page appears.
// Validate that 403 page appears.
// Assumes:
// Create a basic page with alias of "403-error-page" that has text content below.
// admin/config/system/site-information: Default 403 (access denied) page = /403-error-page
//
it('(ATK-CY-1060) Validate that 403 page appears.', {tags: ['@ATK-CY-1060', '@page-error', '@smoke'] }, () => {
const testId = 'ATK-CY-1060'
const badAnonymousUrl = 'admin'
cy.log('**Pull up access denied page for anonymous user with Url of ' + badAnonymousUrl + '.**')
cy.logOutViaUi()
cy.visit(badAnonymousUrl, {failOnStatusCode: false})
cy.contains("403 error page")
})
//
// Validate that 404 page appears.
// Assumes:
// Create a basic page with alias of "404-error-page" that has text content below.
// admin/config/system/site-information: Default Default 404 (not found) page = /404-error-page
//
it('(ATK-CY-1061) Validate 404 page appears.', {tags: ['@ATK-CY-1061', '@page-error', '@smoke'] }, () => {
it('(ATK-CY-1061) Validate that 404 page appears.', {tags: ['@ATK-CY-1061', '@page-error', '@smoke'] }, () => {
const testId = 'ATK-CY-1061'
const randomString = atkUtilities.createRandomString(6)
// debugger
const anonymousBadUrl = 'ATK-CY-1060-BadAnonymousPage-' + randomString
const authenticatedBadUrl = 'ATK-CY-1060-BadAuthenticatedPage-' + randomString
const testId = '(ATK-CY-1061)'
const badAnonymousUrl = testId + '-BadAnonymousPage-' + randomString
const badAuthenticatedUrl = testId + '-BadAuthenticatedPage-' + randomString
cy.log('**Pull up bad page for anonymous user with Url of ' + anonymousBadUrl + '.**')
cy.log('**Pull up bad page for anonymous user with Url of ' + badAnonymousUrl + '.**')
cy.logOutViaUi()
cy.visit(anonymousBadUrl, {failOnStatusCode: false})
cy.contains("ATK Error Page")
cy.visit(badAnonymousUrl, {failOnStatusCode: false})
cy.contains("404 error page")
cy.log('**Pull up bad page for authenticated user with Url of ' + authenticatedBadUrl + '.**')
cy.log('**Pull up bad page for authenticated user with Url of ' + badAuthenticatedUrl + '.**')
cy.logOutViaUi()
cy.logInViaForm(qaUserAccounts.authenticated)
cy.visit(anonymousBadUrl, {failOnStatusCode: false})
cy.contains("ATK Error Page")
cy.visit(badAuthenticatedUrl, {failOnStatusCode: false})
cy.contains("404 erro page")
})
})
......@@ -27,23 +27,33 @@ import qaUserAccounts from '../data/qaUsers.json'
test.describe('Page error tests.', () => {
//
// Validate 403 page appears.
// Validate that 403 page appears.
// Assumes:
// Create a basic page with alias of "403-error-page" that has text content below.
// admin/config/system/site-information:Default 403 (access denied) page = /403-error-page
//
test('(ATK-PW-1060) Validate 403 page appears. @ATK-PW-1060 @page-error @smoke', async ({ page, context }) => {
test('(ATK-PW-1060) Validate that 403 page appears. @ATK-PW-1060 @page-error @smoke', async ({ page, context }) => {
const testId = 'ATK-PW-1060'
const badAnonymousUrl = "admin"
// TODO: This is a stub for now.
console.log('Pull up access denied page for anonymous user with Url of ' + badAnonymousUrl + '.')
await atkCommands.logOutViaUi(page, context)
await page.goto(badAnonymousUrl)
// Should see the 403 message.
let textContent = ''
textContent = await page.content()
expect(textContent).toContain('403 error page')
})
//
// Validate 404 page appears.
// Validate that 404 page appears.
// Assumes:
// Create a basic page with alias of "404-error-page".
// Create a basic page with alias of "404-error-page" that has text content below.
// Set admin/config/system/site-information:Default 404 (not found) page = /404-error-page
//
test('(ATK-PW-1061) Validate 404 page appears. @ATK-PW-1061 @page-error @smoke', async ({ page, context }) => {
test('(ATK-PW-1061) Validate that 404 page appears. @ATK-PW-1061 @page-error @smoke', async ({ page, context }) => {
const testId = 'ATK-PW-1061'
const randomString = atkUtilities.createRandomString(6)
const badAnonymousUrl = testId + '-BadAnonymousPage-' + randomString
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment