mirror of
https://github.com/ansible/awx.git
synced 2024-10-31 23:51:09 +03:00
Merge pull request #3354 from ansible/404_test
404 validation Reviewed-by: https://github.com/softwarefactory-project-zuul[bot]
This commit is contained in:
commit
658bdddac3
45
awx/ui/test/e2e/tests/test-404-behavior.js
Normal file
45
awx/ui/test/e2e/tests/test-404-behavior.js
Normal file
@ -0,0 +1,45 @@
|
||||
import {
|
||||
AWX_E2E_URL,
|
||||
AWX_E2E_TIMEOUT_MEDIUM
|
||||
} from '../settings';
|
||||
|
||||
module.exports = {
|
||||
before: (client) => {
|
||||
client
|
||||
.login()
|
||||
.waitForAngular()
|
||||
.resizeWindow(1200, 1000);
|
||||
},
|
||||
'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();
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue
Block a user