From bcdb590a2931922dd1a7532f2e31003e1cb1411d Mon Sep 17 00:00:00 2001 From: Daniel Sami Date: Tue, 5 Mar 2019 10:55:39 -0500 Subject: [PATCH] 404 tests for varied resources --- awx/ui/test/e2e/tests/test-404-behavior.js | 30 +++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/awx/ui/test/e2e/tests/test-404-behavior.js b/awx/ui/test/e2e/tests/test-404-behavior.js index 7378fa86bc..6effbf8baa 100644 --- a/awx/ui/test/e2e/tests/test-404-behavior.js +++ b/awx/ui/test/e2e/tests/test-404-behavior.js @@ -1,5 +1,6 @@ import { - AWX_E2E_URL + AWX_E2E_URL, + AWX_E2E_TIMEOUT_MEDIUM } from '../settings'; module.exports = { @@ -9,12 +10,35 @@ module.exports = { .waitForAngular() .resizeWindow(1200, 1000); }, - 'Verify 404 page behavior': client => { + 'Test that default the 404 behavior redirects to the dashboard': client => { client.navigateTo(`${AWX_E2E_URL}#/brokenurl`, false); client.useXpath().waitForElementVisible('//job-status-graph'); client.assert.urlContains('#/home'); }, - + 'Test 404 modal for job templates': client => { + client.navigateTo(`${AWX_E2E_URL}#/templates/job_template/99999`, false); + client.expect.element('//*[@id="alert-modal"]') + .to.be.visible.after(AWX_E2E_TIMEOUT_MEDIUM); + client.findThenClick('//*[@id="alert_ok_btn"]'); + }, + 'Test 404 modal for workflow job templates': client => { + client.navigateTo(`${AWX_E2E_URL}#/templates/workflow_job_template/99999`, false); + client.expect.element('//*[@id="alert-modal"]') + .to.be.visible.after(AWX_E2E_TIMEOUT_MEDIUM); + client.findThenClick('//*[@id="alert_ok_btn"]'); + }, + 'Test 404 modal for credentials': client => { + client.navigateTo(`${AWX_E2E_URL}#/credentials/99999`, false); + client.expect.element('//*[@id="alert-modal"]') + .to.be.visible.after(AWX_E2E_TIMEOUT_MEDIUM); + client.findThenClick('//*[@id="alert_ok_btn"]'); + }, + 'Test 404 modal for projects': client => { + client.navigateTo(`${AWX_E2E_URL}#/projects/99999`, false); + client.expect.element('//*[@id="alert-modal"]') + .to.be.visible.after(AWX_E2E_TIMEOUT_MEDIUM); + client.findThenClick('//*[@id="alert_ok_btn"]'); + }, after: client => { client.end(); }