mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-20 03:15:29 -05:00
split promote to studio manager integration tests into subtests
This commit is contained in:
parent
1ec30589f7
commit
a4f71b44fb
1 changed files with 7 additions and 15 deletions
|
@ -71,6 +71,8 @@ describe('studio page while signed out', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('studio management', () => {
|
describe('studio management', () => {
|
||||||
|
// These tests all start on the curators tab of a studio and signed out
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
// expect(projectUrl).toBe(defined);
|
// expect(projectUrl).toBe(defined);
|
||||||
driver = await buildDriver('www-integration studio management');
|
driver = await buildDriver('www-integration studio management');
|
||||||
|
@ -96,7 +98,7 @@ describe('studio management', () => {
|
||||||
|
|
||||||
afterAll(async () => await driver.quit());
|
afterAll(async () => await driver.quit());
|
||||||
|
|
||||||
test('promote to manager', async () => {
|
test('invite a curator', async () => {
|
||||||
// sign in as user2
|
// sign in as user2
|
||||||
await signIn(username2, password, driver);
|
await signIn(username2, password, driver);
|
||||||
await findByXpath('//span[contains(@class, "profile-name")]');
|
await findByXpath('//span[contains(@class, "profile-name")]');
|
||||||
|
@ -107,34 +109,24 @@ describe('studio management', () => {
|
||||||
await inviteBox.sendKeys(username3);
|
await inviteBox.sendKeys(username3);
|
||||||
await clickXpath('//div[@class="studio-adder-row"]/button');
|
await clickXpath('//div[@class="studio-adder-row"]/button');
|
||||||
await findByXpath('//div[@class="alert-msg"]'); // the confirm alert
|
await findByXpath('//div[@class="alert-msg"]'); // the confirm alert
|
||||||
|
});
|
||||||
|
|
||||||
// sign out user2
|
test('accept curator invite', async () => {
|
||||||
await clickXpath('//a[contains(@class, "user-info")]');
|
|
||||||
await clickText('Sign out');
|
|
||||||
|
|
||||||
// Sign in user3
|
// Sign in user3
|
||||||
await driver.get(rootUrl);
|
|
||||||
await driver.sleep(1000);
|
|
||||||
await signIn(username3, password, driver);
|
await signIn(username3, password, driver);
|
||||||
await findByXpath('//span[contains(@class, "profile-name")]');
|
await findByXpath('//span[contains(@class, "profile-name")]');
|
||||||
|
|
||||||
// accept the curator invite
|
// accept the curator invite
|
||||||
await driver.get(curatorTab);
|
|
||||||
await clickXpath('//button[@class="studio-invitation-button button"]');
|
await clickXpath('//button[@class="studio-invitation-button button"]');
|
||||||
await findByXpath('//div[contains(@class,"studio-info-box-success")]');
|
await findByXpath('//div[contains(@class,"studio-info-box-success")]');
|
||||||
|
});
|
||||||
|
|
||||||
// sign out user3
|
test('promote to manager', async () => {
|
||||||
await clickXpath('//a[contains(@class, "user-info")]');
|
|
||||||
await clickText('Sign out');
|
|
||||||
|
|
||||||
// sign in as user2
|
// sign in as user2
|
||||||
await driver.get(rootUrl);
|
|
||||||
await driver.sleep(1000);
|
|
||||||
await signIn(username2, password, driver);
|
await signIn(username2, password, driver);
|
||||||
await findByXpath('//span[contains(@class, "profile-name")]');
|
await findByXpath('//span[contains(@class, "profile-name")]');
|
||||||
|
|
||||||
// promote user3
|
// promote user3
|
||||||
await driver.get(curatorTab);
|
|
||||||
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 + '"]/' +
|
||||||
|
|
Loading…
Reference in a new issue