Clean up studio integration tests

This commit is contained in:
BryceLTaylor 2021-08-20 11:26:00 -04:00
parent f67fcdc495
commit 6ec730887c
2 changed files with 2 additions and 4 deletions

View file

@ -159,7 +159,6 @@ class SeleniumHelper {
await driver.sleep(500); await driver.sleep(500);
await this.clickXpath('//button[contains(@class, "button") and ' + await this.clickXpath('//button[contains(@class, "button") and ' +
'contains(@class, "submit-button") and contains(@class, "white")]'); 'contains(@class, "submit-button") and contains(@class, "white")]');
// await this.findByXpath('//span[contains(@class, "profile-name")]');
} }
urlMatches (regex) { urlMatches (regex) {

View file

@ -85,7 +85,7 @@ describe('studio management', () => {
await clickXpath('//form[@id="new_studio"]/button[@type="submit"]'); await clickXpath('//form[@id="new_studio"]/button[@type="submit"]');
await findByXpath('//div[@class="studio-tabs"]'); await findByXpath('//div[@class="studio-tabs"]');
promoteStudioURL = await driver.getCurrentUrl(); promoteStudioURL = await driver.getCurrentUrl();
curatorTab = await promoteStudioURL + 'curators'; curatorTab = promoteStudioURL + 'curators';
}); });
beforeEach(async () => { beforeEach(async () => {
@ -134,11 +134,10 @@ describe('studio management', () => {
// promote user3 // promote user3
let user3href = '/users/' + username3; let user3href = '/users/' + username3;
// click kebab menu on the user tile // click kebab menu on the user tile
let kebabMenuXpath = '//a[@href = "' + user3href + '"]/' + let kebabMenuXpath = `//a[@href = "${user3href}"]/` +
'following-sibling::div[@class="overflow-menu-container"]'; 'following-sibling::div[@class="overflow-menu-container"]';
await clickXpath(kebabMenuXpath + '/button[@class="overflow-menu-trigger"]'); await clickXpath(kebabMenuXpath + '/button[@class="overflow-menu-trigger"]');
// click promote // click promote
// await clickXpath(kebabMenuXpath + '/ul/li/button[@class="promote-button"]');
// await clickXpath('//button[@class="promote-menu-button"]'); //<-- I think this will do it // await clickXpath('//button[@class="promote-menu-button"]'); //<-- I think this will do it
await clickXpath(kebabMenuXpath + '/ul/li/button/span[contains(text(), "Promote")]/..'); await clickXpath(kebabMenuXpath + '/ul/li/button/span[contains(text(), "Promote")]/..');
await findByXpath('//div[@class="promote-content"]'); await findByXpath('//div[@class="promote-content"]');