1
0
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:
softwarefactory-project-zuul[bot] 2019-03-05 17:19:52 +00:00 committed by GitHub
commit 658bdddac3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View 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();
}
};