1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +03:00

add e2e test for credential copy

This commit is contained in:
Jake McDermott 2017-12-05 17:39:17 -05:00
parent 50d95ddc3f
commit d56f1a0120
No known key found for this signature in database
GPG Key ID: 3B02CAD476EECB35

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