mirror of
https://github.com/ansible/awx.git
synced 2026-05-14 21:07:39 -02:30
update object fields and commands
This commit is contained in:
@@ -26,32 +26,51 @@ const header = {
|
||||
}]
|
||||
};
|
||||
|
||||
module.exports = ({ elements, sections, commands }) => ({
|
||||
selector: 'table',
|
||||
sections: {
|
||||
header,
|
||||
dynamicSection
|
||||
},
|
||||
commands: [{
|
||||
findRowByText (text) {
|
||||
return this.section.dynamicSection.create({
|
||||
elements,
|
||||
sections,
|
||||
commands,
|
||||
name: `row[${text}]`,
|
||||
locateStrategy: 'xpath',
|
||||
selector: `.//tbody/tr/td//*[normalize-space(text())='${text}']/ancestor::tr`
|
||||
});
|
||||
const createTableSection = ({ elements, sections, commands }) => {
|
||||
const tableSection = {
|
||||
selector: 'table',
|
||||
sections: {
|
||||
header,
|
||||
dynamicSection
|
||||
},
|
||||
waitForRowCount (count) {
|
||||
const countReached = `tbody tr:nth-of-type(${count})`;
|
||||
this.waitForElementPresent(countReached);
|
||||
commands: [{
|
||||
findRowByText (text) {
|
||||
return this.section.dynamicSection.create({
|
||||
elements,
|
||||
sections,
|
||||
commands,
|
||||
name: `row[${text}]`,
|
||||
locateStrategy: 'xpath',
|
||||
selector: `.//tbody/tr/td//*[normalize-space(text())='${text}']/ancestor::tr`
|
||||
});
|
||||
},
|
||||
findRowByIndex (index) {
|
||||
return this.section.dynamicSection.create({
|
||||
elements,
|
||||
sections,
|
||||
commands,
|
||||
name: `row[${index}]`,
|
||||
locateStrategy: 'xpath',
|
||||
selector: `.//tbody/tr[${index}]`
|
||||
});
|
||||
},
|
||||
clickRowByIndex (index) {
|
||||
this.findRowByIndex(index).click('@self');
|
||||
return this;
|
||||
},
|
||||
waitForRowCount (count) {
|
||||
const countReached = this.findRowByIndex(count);
|
||||
countReached.waitForElementVisible('@self', 10000);
|
||||
|
||||
const countExceeded = `tbody tr:nth-of-type(${count + 1})`;
|
||||
this.waitForElementNotPresent(countExceeded);
|
||||
const countExceeded = this.findRowByIndex(count + 1);
|
||||
countExceeded.waitForElementNotPresent('@self', 10000);
|
||||
|
||||
return this;
|
||||
}
|
||||
}]
|
||||
});
|
||||
return this;
|
||||
}
|
||||
}]
|
||||
};
|
||||
|
||||
return tableSection;
|
||||
};
|
||||
|
||||
module.exports = createTableSection;
|
||||
|
||||
@@ -8,7 +8,8 @@ const lookupModal = {
|
||||
close: 'i[class="fa fa-times-circle"]',
|
||||
title: 'div[class^="Form-title"]',
|
||||
select: 'button[class*="save"]',
|
||||
cancel: 'button[class*="cancel"]'
|
||||
cancel: 'button[class*="cancel"]',
|
||||
save: 'button[class*="save"]'
|
||||
},
|
||||
sections: {
|
||||
search,
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
const search = {
|
||||
selector: 'smart-search',
|
||||
locateStrategy: 'css selector',
|
||||
elements: {
|
||||
clearAll: '.SmartSearch-clearAll',
|
||||
searchButton: '.SmartSearch-searchButton',
|
||||
input: '.SmartSearch-input',
|
||||
clearAll: 'a[class*="clear"]',
|
||||
searchButton: 'i[class$="search"]',
|
||||
input: 'input',
|
||||
tags: '.SmartSearch-tagContainer'
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user