mirror of
https://github.com/ansible/awx.git
synced 2026-01-12 18:40:01 -03:30
Merge pull request #3674 from ansible/splits
added ws and pending to user e2e Reviewed-by: https://github.com/softwarefactory-project-zuul[bot]
This commit is contained in:
commit
0252af0d30
@ -312,7 +312,8 @@ const getJobTemplate = (
|
||||
namespace = session,
|
||||
playbook = 'hello_world.yml',
|
||||
name = `${namespace}-job-template`,
|
||||
updateProject = true
|
||||
updateProject = true,
|
||||
jobSliceCount = 1
|
||||
) => {
|
||||
const promises = [
|
||||
getInventory(namespace),
|
||||
@ -332,6 +333,7 @@ const getJobTemplate = (
|
||||
credential: credential.id,
|
||||
project: project.id,
|
||||
playbook: `${playbook}`,
|
||||
job_slice_count: `${jobSliceCount}`,
|
||||
}));
|
||||
};
|
||||
|
||||
|
||||
@ -7,6 +7,7 @@ import {
|
||||
getOrganization,
|
||||
getProject,
|
||||
getJob,
|
||||
getJobTemplate,
|
||||
getUpdatedProject
|
||||
} from '../fixtures';
|
||||
|
||||
@ -22,6 +23,7 @@ let data;
|
||||
// Xpath selectors for recently run job templates on the dashboard.
|
||||
const successfulJt = '//a[contains(text(), "test-websockets-successful")]/../..';
|
||||
const failedJt = '//a[contains(text(), "test-websockets-failed")]/../..';
|
||||
const splitJt = '//a[contains(text(), "test-ws-split-job-template")]/../..';
|
||||
const sparklineIcon = '//div[contains(@class, "SmartStatus-iconContainer")]';
|
||||
|
||||
// Xpath selectors for sparkline icon statuses.
|
||||
@ -38,12 +40,14 @@ module.exports = {
|
||||
getOrganization('test-websockets'),
|
||||
// launch job templates once before running tests so that they appear on the dashboard.
|
||||
getJob('test-websockets', 'debug.yml', 'test-websockets-successful', done),
|
||||
getJob('test-websockets', 'fail_unless.yml', 'test-websockets-failed', done)
|
||||
getJob('test-websockets', 'fail_unless.yml', 'test-websockets-failed', done),
|
||||
getJobTemplate('test-websockets', 'debug.yml', 'test-ws-split-job-template', true, '2'),
|
||||
getJob('test-websockets', 'debug.yml', 'test-ws-split-job-template', done)
|
||||
];
|
||||
|
||||
Promise.all(resources)
|
||||
.then(([inventory, project, org, jt1, jt2]) => {
|
||||
data = { inventory, project, org, jt1, jt2 };
|
||||
.then(([inventory, project, org, jt1, jt2, sjt, sj]) => {
|
||||
data = { inventory, project, org, jt1, jt2, sjt, sj };
|
||||
done();
|
||||
});
|
||||
|
||||
@ -154,7 +158,32 @@ module.exports = {
|
||||
client.expect.element('i.icon-job-success')
|
||||
.to.be.visible.before(AWX_E2E_TIMEOUT_ASYNC);
|
||||
},
|
||||
'Test job slicing sparkline behavior': client => {
|
||||
client.findThenClick('[ui-sref=dashboard]', 'css');
|
||||
getJob('test-ws-split-job-template', 'debug.yml', 'test-websockets-failed', false);
|
||||
|
||||
client.expect.element('.spinny')
|
||||
.to.not.be.visible.before(AWX_E2E_TIMEOUT_MEDIUM);
|
||||
client.useXpath().expect.element(`${sparklineIcon}[1]${running}`)
|
||||
.to.be.visible.before(AWX_E2E_TIMEOUT_LONG);
|
||||
client.useXpath().expect.element(`${splitJt}${sparklineIcon}[1]${success}`)
|
||||
.to.be.present.before(AWX_E2E_TIMEOUT_LONG);
|
||||
},
|
||||
'Test pending deletion of inventories': client => {
|
||||
getInventorySource('test-pending-delete');
|
||||
client
|
||||
.useCss()
|
||||
.navigateTo(`${AWX_E2E_URL}/#/inventories`)
|
||||
.waitForElementVisible('.SmartSearch-input')
|
||||
.clearValue('.SmartSearch-input')
|
||||
.setValue('.SmartSearch-input', ['test-pending-delete', client.Keys.ENTER])
|
||||
.waitForSpinny()
|
||||
.findThenClick('.fa-trash-o', 'css')
|
||||
.waitForElementVisible('#prompt_action_btn')
|
||||
.click('#prompt_action_btn');
|
||||
client.useCss().expect.element('[ng-if="inventory.pending_deletion"]')
|
||||
.to.be.visible.before(AWX_E2E_TIMEOUT_MEDIUM);
|
||||
},
|
||||
after: client => {
|
||||
client.end();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user