mirror of
https://github.com/ansible/awx.git
synced 2026-03-21 10:57:36 -02:30
e2e stability backport for 3.5
This commit is contained in:
@@ -5,7 +5,6 @@
|
|||||||
exports.command = function logout () {
|
exports.command = function logout () {
|
||||||
const logoutButton = '.at-Layout-topNav i.fa-power-off';
|
const logoutButton = '.at-Layout-topNav i.fa-power-off';
|
||||||
this
|
this
|
||||||
.waitForElementVisible(logoutButton)
|
.findThenClick(logoutButton, 'css')
|
||||||
.click(logoutButton)
|
|
||||||
.waitForElementPresent('#login-button');
|
.waitForElementPresent('#login-button');
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ module.exports = {
|
|||||||
this
|
this
|
||||||
.waitForElementVisible('#alert-modal-msg')
|
.waitForElementVisible('#alert-modal-msg')
|
||||||
.expect.element('#alert-modal-msg').text.contain(application.name);
|
.expect.element('#alert-modal-msg').text.contain(application.name);
|
||||||
this.click('#alert_ok_btn');
|
this.findThenClick('#alert_ok_btn', 'css');
|
||||||
this.waitForElementNotVisible('#alert-modal-msg');
|
this.waitForElementNotVisible('#alert-modal-msg');
|
||||||
},
|
},
|
||||||
delete (name) {
|
delete (name) {
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ const store = {
|
|||||||
lastName: `last-admin-${testID}`,
|
lastName: `last-admin-${testID}`,
|
||||||
password: `admin-${testID}`,
|
password: `admin-${testID}`,
|
||||||
username: `admin-${testID}`,
|
username: `admin-${testID}`,
|
||||||
|
usernameDefault: `user-${testID}`,
|
||||||
type: 'administrator',
|
type: 'administrator',
|
||||||
},
|
},
|
||||||
auditor: {
|
auditor: {
|
||||||
@@ -28,6 +29,7 @@ const store = {
|
|||||||
lastName: `last-auditor-${testID}`,
|
lastName: `last-auditor-${testID}`,
|
||||||
password: `auditor-${testID}`,
|
password: `auditor-${testID}`,
|
||||||
username: `auditor-${testID}`,
|
username: `auditor-${testID}`,
|
||||||
|
usernameDefault: `user-${testID}`,
|
||||||
type: 'auditor',
|
type: 'auditor',
|
||||||
},
|
},
|
||||||
user: {
|
user: {
|
||||||
@@ -36,12 +38,20 @@ const store = {
|
|||||||
lastName: `last-${testID}`,
|
lastName: `last-${testID}`,
|
||||||
password: `${testID}`,
|
password: `${testID}`,
|
||||||
username: `user-${testID}`,
|
username: `user-${testID}`,
|
||||||
|
usernameDefault: `user-${testID}`,
|
||||||
type: 'normal',
|
type: 'normal',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
before: (client, done) => {
|
before: (client, done) => {
|
||||||
|
// generate a unique username on each attempt.
|
||||||
|
const uniqueUser = uuid().substr(0, 8);
|
||||||
|
Object.entries(store).forEach(([key]) => {
|
||||||
|
if ('username' in store[key]) {
|
||||||
|
store[key].username = `${store[key].usernameDefault}-${uniqueUser}`;
|
||||||
|
}
|
||||||
|
});
|
||||||
const resources = [
|
const resources = [
|
||||||
getOrganization(store.organization.name),
|
getOrganization(store.organization.name),
|
||||||
getAuditor(store.auditor.username),
|
getAuditor(store.auditor.username),
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/* Websocket tests. These tests verify that items like the sparkline (colored box rows which
|
/* Websocket tests. These tests verify that items like the sparkline (colored box rows which
|
||||||
* display job status) and other status icons update correctly as the jobs progress.
|
* display job status) and other status icons update correctly as the jobs progress.
|
||||||
*/
|
*/
|
||||||
|
import uuid from 'uuid';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
getInventorySource,
|
getInventorySource,
|
||||||
@@ -160,13 +161,14 @@ module.exports = {
|
|||||||
.to.be.present.before(AWX_E2E_TIMEOUT_ASYNC);
|
.to.be.present.before(AWX_E2E_TIMEOUT_ASYNC);
|
||||||
},
|
},
|
||||||
'Test pending deletion of inventories': client => {
|
'Test pending deletion of inventories': client => {
|
||||||
getInventorySource('test-pending-delete');
|
const uniqueID = uuid().substr(0, 8);
|
||||||
|
getInventorySource(`test-pending-delete-${uniqueID}`);
|
||||||
client
|
client
|
||||||
.useCss()
|
.useCss()
|
||||||
.navigateTo(`${AWX_E2E_URL}/#/inventories`, false)
|
.navigateTo(`${AWX_E2E_URL}/#/inventories`, false)
|
||||||
.waitForElementVisible('.SmartSearch-input')
|
.waitForElementVisible('.SmartSearch-input')
|
||||||
.clearValue('.SmartSearch-input')
|
.clearValue('.SmartSearch-input')
|
||||||
.setValue('.SmartSearch-input', ['test-pending-delete', client.Keys.ENTER])
|
.setValue('.SmartSearch-input', [`test-pending-delete-${uniqueID}`, client.Keys.ENTER])
|
||||||
.pause(AWX_E2E_TIMEOUT_SHORT) // helps prevent flake
|
.pause(AWX_E2E_TIMEOUT_SHORT) // helps prevent flake
|
||||||
.findThenClick('.fa-trash-o', 'css')
|
.findThenClick('.fa-trash-o', 'css')
|
||||||
.waitForElementVisible('#prompt_action_btn')
|
.waitForElementVisible('#prompt_action_btn')
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import uuid from 'uuid';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
getInventorySource,
|
getInventorySource,
|
||||||
getJobTemplate,
|
getJobTemplate,
|
||||||
@@ -7,15 +9,12 @@ import {
|
|||||||
|
|
||||||
import {
|
import {
|
||||||
AWX_E2E_URL,
|
AWX_E2E_URL,
|
||||||
AWX_E2E_TIMEOUT_LONG
|
|
||||||
} from '../settings';
|
} from '../settings';
|
||||||
|
|
||||||
let data;
|
let data;
|
||||||
const spinny = "//*[contains(@class, 'spinny')]";
|
const spinny = "//*[contains(@class, 'spinny')]";
|
||||||
const workflowSelector = "//a[text()='test-actions-workflow-template']";
|
|
||||||
const workflowVisualizerBtn = "//button[contains(@id, 'workflow_job_template_workflow_visualizer_btn')]";
|
const workflowVisualizerBtn = "//button[contains(@id, 'workflow_job_template_workflow_visualizer_btn')]";
|
||||||
const workflowSearchBar = "//input[contains(@class, 'SmartSearch-input')]";
|
const workflowSearchBar = "//input[contains(@class, 'SmartSearch-input')]";
|
||||||
const workflowText = 'name.iexact:"test-actions-workflow-template"';
|
|
||||||
|
|
||||||
const startNodeId = '1';
|
const startNodeId = '1';
|
||||||
let initialJobNodeId;
|
let initialJobNodeId;
|
||||||
@@ -26,10 +25,6 @@ let leafNodeId;
|
|||||||
const nodeAdd = "//*[contains(@class, 'WorkflowChart-nodeAddIcon')]";
|
const nodeAdd = "//*[contains(@class, 'WorkflowChart-nodeAddIcon')]";
|
||||||
const nodeRemove = "//*[contains(@class, 'WorkflowChart-nodeRemoveIcon')]";
|
const nodeRemove = "//*[contains(@class, 'WorkflowChart-nodeRemoveIcon')]";
|
||||||
|
|
||||||
// one of the jobs or projects or inventories
|
|
||||||
const testActionsJob = "//div[contains(@class, 'List-tableCell') and contains(text(), 'test-actions-job')]";
|
|
||||||
const testActionsJobText = 'name.iexact:"test-actions-job-template"';
|
|
||||||
|
|
||||||
// search bar for visualizer templates
|
// search bar for visualizer templates
|
||||||
const jobSearchBar = "//*[contains(@id, 'workflow-jobs-list')]//input[contains(@class, 'SmartSearch-input')]";
|
const jobSearchBar = "//*[contains(@id, 'workflow-jobs-list')]//input[contains(@class, 'SmartSearch-input')]";
|
||||||
|
|
||||||
@@ -49,51 +44,50 @@ const deleteConfirmation = "//button[@ng-click='confirmDeleteNode()']";
|
|||||||
|
|
||||||
const xPathNodeById = (id) => `//*[@id='node-${id}']`;
|
const xPathNodeById = (id) => `//*[@id='node-${id}']`;
|
||||||
const xPathLinkById = (sourceId, targetId) => `//*[@id='link-${sourceId}-${targetId}']//*[contains(@class, 'WorkflowChart-linkPath')]`;
|
const xPathLinkById = (sourceId, targetId) => `//*[@id='link-${sourceId}-${targetId}']//*[contains(@class, 'WorkflowChart-linkPath')]`;
|
||||||
|
const xPathNodeByName = (name) => `//*[contains(@class, "WorkflowChart-nameText") and contains(text(), "${name}")]/..`;
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
before: (client, done) => {
|
before: (client, done) => {
|
||||||
|
// Ensure deterministic state on retries
|
||||||
|
const testID = uuid().substr(0, 8);
|
||||||
|
const namespace = `test-actions-${testID}`;
|
||||||
const resources = [
|
const resources = [
|
||||||
getInventorySource('test-actions'),
|
getInventorySource(namespace),
|
||||||
getJobTemplate('test-actions'),
|
getJobTemplate(namespace),
|
||||||
getProject('test-actions'),
|
getProject(namespace),
|
||||||
getWorkflowTemplate('test-actions'),
|
getWorkflowTemplate(namespace),
|
||||||
];
|
];
|
||||||
|
|
||||||
Promise.all(resources)
|
Promise.all(resources)
|
||||||
.then(([source, template, project, workflow]) => {
|
.then(([inventory, template, project, workflow]) => {
|
||||||
data = { source, template, project, workflow };
|
data = { inventory, template, project, workflow };
|
||||||
|
client
|
||||||
|
.login()
|
||||||
|
.waitForAngular()
|
||||||
|
.resizeWindow(1200, 1000)
|
||||||
|
.navigateTo(`${AWX_E2E_URL}/#/templates`, false)
|
||||||
|
.useXpath()
|
||||||
|
.waitForElementVisible(workflowSearchBar)
|
||||||
|
.setValue(workflowSearchBar, [`name.iexact:"${data.workflow.name}"`])
|
||||||
|
.click('//*[contains(@class, "SmartSearch-searchButton")]')
|
||||||
|
.waitForSpinny(true)
|
||||||
|
.click(`//a[text()="${namespace}-workflow-template"]`)
|
||||||
|
.waitForElementVisible(workflowVisualizerBtn)
|
||||||
|
.click(workflowVisualizerBtn)
|
||||||
|
.waitForSpinny(true);
|
||||||
|
client.waitForElementVisible(xPathNodeByName(`${namespace}-job`));
|
||||||
|
// Grab the ids of the nodes
|
||||||
|
client.getAttribute(xPathNodeByName(`${namespace}-job`), 'id', (res) => {
|
||||||
|
initialJobNodeId = res.value.split('-')[1];
|
||||||
|
});
|
||||||
|
client.getAttribute(xPathNodeByName(`${namespace}-pro`), 'id', (res) => {
|
||||||
|
initialProjectNodeId = res.value.split('-')[1];
|
||||||
|
});
|
||||||
|
client.getAttribute(xPathNodeByName(`${namespace}-inv`), 'id', (res) => {
|
||||||
|
initialInventoryNodeId = res.value.split('-')[1];
|
||||||
|
});
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
client
|
|
||||||
.login()
|
|
||||||
.waitForAngular()
|
|
||||||
.resizeWindow(1200, 1000)
|
|
||||||
.navigateTo(`${AWX_E2E_URL}/#/templates`, false)
|
|
||||||
.useXpath()
|
|
||||||
.waitForElementVisible(workflowSearchBar)
|
|
||||||
.setValue(workflowSearchBar, [workflowText])
|
|
||||||
.click('//*[contains(@class, "SmartSearch-searchButton")]')
|
|
||||||
.waitForSpinny(true)
|
|
||||||
.click('//*[contains(@class, "SmartSearch-clearAll")]')
|
|
||||||
.waitForSpinny(true)
|
|
||||||
.setValue(workflowSearchBar, [workflowText])
|
|
||||||
.click('//*[contains(@class, "SmartSearch-searchButton")]')
|
|
||||||
.waitForSpinny(true)
|
|
||||||
.click(workflowSelector)
|
|
||||||
.waitForSpinny(true)
|
|
||||||
.click(workflowVisualizerBtn);
|
|
||||||
client.waitForElementVisible('//*[contains(@class, "WorkflowChart-nameText") and contains(text(), "test-actions-job")]/..');
|
|
||||||
|
|
||||||
// Grab the ids of the nodes
|
|
||||||
client.getAttribute('//*[contains(@class, "WorkflowChart-nameText") and contains(text(), "test-actions-job")]/..', 'id', (res) => {
|
|
||||||
initialJobNodeId = res.value.split('-')[1];
|
|
||||||
});
|
|
||||||
client.getAttribute('//*[contains(@class, "WorkflowChart-nameText") and contains(text(), "test-actions-project")]/..', 'id', (res) => {
|
|
||||||
initialProjectNodeId = res.value.split('-')[1];
|
|
||||||
});
|
|
||||||
client.getAttribute('//*[contains(@class, "WorkflowChart-nameText") and contains(text(), "test-actions-inventory")]/..', 'id', (res) => {
|
|
||||||
initialInventoryNodeId = res.value.split('-')[1];
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
'verify that workflow visualizer new root node can only be set to always': client => {
|
'verify that workflow visualizer new root node can only be set to always': client => {
|
||||||
client
|
client
|
||||||
@@ -143,9 +137,9 @@ module.exports = {
|
|||||||
client
|
client
|
||||||
.waitForElementVisible(jobSearchBar)
|
.waitForElementVisible(jobSearchBar)
|
||||||
.clearValue(jobSearchBar)
|
.clearValue(jobSearchBar)
|
||||||
.setValue(jobSearchBar, [testActionsJobText, client.Keys.ENTER])
|
.setValue(jobSearchBar, [`name.iexact:"${data.template.name}"`, client.Keys.ENTER])
|
||||||
.pause(1000)
|
.pause(1000)
|
||||||
.findThenClick(testActionsJob)
|
.findThenClick(`//div[contains(@class, "List-tableCell") and contains(text(), "${data.template.name}")]`)
|
||||||
.pause(1000)
|
.pause(1000)
|
||||||
.waitForElementNotVisible(spinny)
|
.waitForElementNotVisible(spinny)
|
||||||
.findThenClick(edgeTypeDropdownBar)
|
.findThenClick(edgeTypeDropdownBar)
|
||||||
@@ -174,9 +168,9 @@ module.exports = {
|
|||||||
client
|
client
|
||||||
.waitForElementVisible(jobSearchBar)
|
.waitForElementVisible(jobSearchBar)
|
||||||
.clearValue(jobSearchBar)
|
.clearValue(jobSearchBar)
|
||||||
.setValue(jobSearchBar, [testActionsJobText, client.Keys.ENTER])
|
.setValue(jobSearchBar, [`name.iexact:"${data.template.name}"`, client.Keys.ENTER])
|
||||||
.pause(1000)
|
.pause(1000)
|
||||||
.findThenClick(testActionsJob)
|
.findThenClick(`//div[contains(@class, "List-tableCell") and contains(text(), "${data.template.name}")]`)
|
||||||
.pause(1000)
|
.pause(1000)
|
||||||
.waitForElementNotVisible(spinny)
|
.waitForElementNotVisible(spinny)
|
||||||
.findThenClick(edgeTypeDropdownBar)
|
.findThenClick(edgeTypeDropdownBar)
|
||||||
|
|||||||
Reference in New Issue
Block a user