mirror of
https://github.com/ansible/awx.git
synced 2024-10-31 23:51:09 +03:00
add e2e test for credential copy
This commit is contained in:
parent
50d95ddc3f
commit
d56f1a0120
50
awx/ui/test/e2e/tests/test-credentials-list-actions.js
Normal file
50
awx/ui/test/e2e/tests/test-credentials-list-actions.js
Normal file
@ -0,0 +1,50 @@
|
||||
import { getAdminMachineCredential } from '../fixtures';
|
||||
|
||||
const data = {};
|
||||
|
||||
module.exports = {
|
||||
before: (client, done) => {
|
||||
getAdminMachineCredential('test-actions')
|
||||
.then(obj => { data.credential = obj; })
|
||||
.then(done);
|
||||
},
|
||||
'copy credential': client => {
|
||||
const credentials = client.page.credentials();
|
||||
|
||||
client.useCss();
|
||||
client.resizeWindow(1200, 800);
|
||||
client.login();
|
||||
client.waitForAngular();
|
||||
|
||||
credentials.navigate();
|
||||
credentials.waitForElementVisible('div.spinny');
|
||||
credentials.waitForElementNotVisible('div.spinny');
|
||||
|
||||
credentials.section.list.expect.element('smart-search').visible;
|
||||
credentials.section.list.expect.element('smart-search input').enabled;
|
||||
|
||||
credentials.section.list
|
||||
.sendKeys('smart-search input', `id:>${data.credential.id - 1} id:<${data.credential.id + 1}`)
|
||||
.sendKeys('smart-search input', client.Keys.ENTER);
|
||||
|
||||
credentials.waitForElementVisible('div.spinny');
|
||||
credentials.waitForElementNotVisible('div.spinny');
|
||||
|
||||
credentials.expect.element(`#credentials_table tr[id="${data.credential.id}"]`).visible;
|
||||
credentials.expect.element('i[class*="copy"]').visible;
|
||||
credentials.expect.element('i[class*="copy"]').enabled;
|
||||
|
||||
credentials.click('i[class*="copy"]');
|
||||
credentials.waitForElementVisible('div.spinny');
|
||||
credentials.waitForElementNotVisible('div.spinny');
|
||||
|
||||
credentials.expect.element('div[ui-view="edit"] form').visible;
|
||||
credentials.section.edit.expect.element('@title').visible;
|
||||
credentials.section.edit.expect.element('@title').text.contain(data.credential.name);
|
||||
credentials.section.edit.expect.element('@title').text.not.equal(data.credential.name);
|
||||
credentials.section.edit.section.details.expect.element('@save').visible;
|
||||
credentials.section.edit.section.details.expect.element('@save').enabled;
|
||||
|
||||
client.end();
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue
Block a user