[e2e] More VIPER compatibility fixes (#5582)

This commit is contained in:
Jesse Mazzella
2022-07-29 16:50:40 -07:00
committed by GitHub
parent 22924f18fc
commit fc3614dfbd
11 changed files with 148 additions and 123 deletions

View File

@ -37,11 +37,16 @@
* @param {string | undefined} name
*/
async function createDomainObjectWithDefaults(page, type, name) {
// Navigate to focus the 'My Items' folder, and hide the object tree
// This is necessary so that subsequent objects can be created without a parent
// TODO: Ideally this would navigate to a common `e2e` folder
await page.goto('./#/browse/mine?hideTree=true');
await page.waitForLoadState('networkidle');
//Click the Create button
await page.click('button:has-text("Create")');
// Click the object specified by 'type'
await page.click(`text=${type}`);
await page.click(`li:text("${type}")`);
// Modify the name input field of the domain object to accept 'name'
if (name) {
@ -52,9 +57,13 @@ async function createDomainObjectWithDefaults(page, type, name) {
// Click OK button and wait for Navigate event
await Promise.all([
page.waitForNavigation({waitUntil: 'networkidle'}),
page.click('text=OK')
page.waitForNavigation(),
page.click('[aria-label="Save"]'),
// Wait for Save Banner to appear
page.waitForSelector('.c-message-banner__message')
]);
return name || `Unnamed ${type}`;
}
/**