mirror of
https://github.com/ansible/awx.git
synced 2026-02-28 08:18:43 -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:
@@ -312,7 +312,8 @@ const getJobTemplate = (
|
|||||||
namespace = session,
|
namespace = session,
|
||||||
playbook = 'hello_world.yml',
|
playbook = 'hello_world.yml',
|
||||||
name = `${namespace}-job-template`,
|
name = `${namespace}-job-template`,
|
||||||
updateProject = true
|
updateProject = true,
|
||||||
|
jobSliceCount = 1
|
||||||
) => {
|
) => {
|
||||||
const promises = [
|
const promises = [
|
||||||
getInventory(namespace),
|
getInventory(namespace),
|
||||||
@@ -332,6 +333,7 @@ const getJobTemplate = (
|
|||||||
credential: credential.id,
|
credential: credential.id,
|
||||||
project: project.id,
|
project: project.id,
|
||||||
playbook: `${playbook}`,
|
playbook: `${playbook}`,
|
||||||
|
job_slice_count: `${jobSliceCount}`,
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import {
|
|||||||
getOrganization,
|
getOrganization,
|
||||||
getProject,
|
getProject,
|
||||||
getJob,
|
getJob,
|
||||||
|
getJobTemplate,
|
||||||
getUpdatedProject
|
getUpdatedProject
|
||||||
} from '../fixtures';
|
} from '../fixtures';
|
||||||
|
|
||||||
@@ -22,6 +23,7 @@ let data;
|
|||||||
// Xpath selectors for recently run job templates on the dashboard.
|
// Xpath selectors for recently run job templates on the dashboard.
|
||||||
const successfulJt = '//a[contains(text(), "test-websockets-successful")]/../..';
|
const successfulJt = '//a[contains(text(), "test-websockets-successful")]/../..';
|
||||||
const failedJt = '//a[contains(text(), "test-websockets-failed")]/../..';
|
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")]';
|
const sparklineIcon = '//div[contains(@class, "SmartStatus-iconContainer")]';
|
||||||
|
|
||||||
// Xpath selectors for sparkline icon statuses.
|
// Xpath selectors for sparkline icon statuses.
|
||||||
@@ -38,12 +40,14 @@ module.exports = {
|
|||||||
getOrganization('test-websockets'),
|
getOrganization('test-websockets'),
|
||||||
// launch job templates once before running tests so that they appear on the dashboard.
|
// 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', '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)
|
Promise.all(resources)
|
||||||
.then(([inventory, project, org, jt1, jt2]) => {
|
.then(([inventory, project, org, jt1, jt2, sjt, sj]) => {
|
||||||
data = { inventory, project, org, jt1, jt2 };
|
data = { inventory, project, org, jt1, jt2, sjt, sj };
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -154,7 +158,32 @@ module.exports = {
|
|||||||
client.expect.element('i.icon-job-success')
|
client.expect.element('i.icon-job-success')
|
||||||
.to.be.visible.before(AWX_E2E_TIMEOUT_ASYNC);
|
.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 => {
|
after: client => {
|
||||||
client.end();
|
client.end();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user