mirror of
https://github.com/ansible/awx.git
synced 2026-03-29 06:45:09 -02:30
add e2e test for inventory script copy
This commit is contained in:
50
awx/ui/test/e2e/tests/test-inventory-scripts-list-actions.js
Normal file
50
awx/ui/test/e2e/tests/test-inventory-scripts-list-actions.js
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
import { getInventoryScript } from '../fixtures';
|
||||||
|
|
||||||
|
const data = {};
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
before: (client, done) => {
|
||||||
|
getInventoryScript('test-actions')
|
||||||
|
.then(obj => { data.inventoryScript = obj; })
|
||||||
|
.then(done);
|
||||||
|
},
|
||||||
|
'copy inventory script': client => {
|
||||||
|
const inventoryScripts = client.page.inventoryScripts();
|
||||||
|
|
||||||
|
client.useCss();
|
||||||
|
client.resizeWindow(1200, 800);
|
||||||
|
client.login();
|
||||||
|
client.waitForAngular();
|
||||||
|
|
||||||
|
inventoryScripts.navigate();
|
||||||
|
inventoryScripts.waitForElementVisible('div.spinny');
|
||||||
|
inventoryScripts.waitForElementNotVisible('div.spinny');
|
||||||
|
|
||||||
|
inventoryScripts.section.list.expect.element('smart-search').visible;
|
||||||
|
inventoryScripts.section.list.expect.element('smart-search input').enabled;
|
||||||
|
|
||||||
|
inventoryScripts.section.list
|
||||||
|
.sendKeys('smart-search input', `id:>${data.inventoryScript.id - 1} id:<${data.inventoryScript.id + 1}`)
|
||||||
|
.sendKeys('smart-search input', client.Keys.ENTER);
|
||||||
|
|
||||||
|
inventoryScripts.waitForElementVisible('div.spinny');
|
||||||
|
inventoryScripts.waitForElementNotVisible('div.spinny');
|
||||||
|
|
||||||
|
inventoryScripts.expect.element(`#inventory_scripts_table tr[id="${data.inventoryScript.id}"]`).visible;
|
||||||
|
inventoryScripts.expect.element('i[class*="copy"]').visible;
|
||||||
|
inventoryScripts.expect.element('i[class*="copy"]').enabled;
|
||||||
|
|
||||||
|
inventoryScripts.click('i[class*="copy"]');
|
||||||
|
inventoryScripts.waitForElementVisible('div.spinny');
|
||||||
|
inventoryScripts.waitForElementNotVisible('div.spinny');
|
||||||
|
|
||||||
|
inventoryScripts.expect.element('#inventory_script_form').visible;
|
||||||
|
inventoryScripts.section.edit.expect.element('@title').visible;
|
||||||
|
inventoryScripts.section.edit.expect.element('@title').text.contain(data.inventoryScript.name);
|
||||||
|
inventoryScripts.section.edit.expect.element('@title').text.not.equal(data.inventoryScript.name);
|
||||||
|
inventoryScripts.expect.element('@save').visible;
|
||||||
|
inventoryScripts.expect.element('@save').enabled;
|
||||||
|
|
||||||
|
client.end();
|
||||||
|
}
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user