mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-17 00:21:20 -05:00
move studio creation for management integration tests to beforeAll
This commit is contained in:
parent
2e5055e05a
commit
1ec30589f7
1 changed files with 16 additions and 11 deletions
|
@ -24,6 +24,7 @@ let username3 = process.env.SMOKE_USERNAME + '3';
|
|||
let password = process.env.SMOKE_PASSWORD;
|
||||
|
||||
let promoteStudioURL;
|
||||
let curatorTab;
|
||||
|
||||
if (remote){
|
||||
jest.setTimeout(70000);
|
||||
|
@ -72,30 +73,34 @@ describe('studio page while signed out', () => {
|
|||
describe('studio management', () => {
|
||||
beforeAll(async () => {
|
||||
// expect(projectUrl).toBe(defined);
|
||||
driver = await buildDriver('www-integration studio-page signed out');
|
||||
driver = await buildDriver('www-integration studio management');
|
||||
await driver.get(rootUrl);
|
||||
|
||||
// create a studio for tests
|
||||
await signIn(username2, password, driver);
|
||||
await findByXpath('//span[contains(@class, "profile-name")]');
|
||||
await driver.get(rateLimitCheck);
|
||||
await driver.get(myStuffURL);
|
||||
await clickXpath('//form[@id="new_studio"]/button[@type="submit"]');
|
||||
await findByXpath('//div[@class="studio-tabs"]');
|
||||
promoteStudioURL = await driver.getCurrentUrl();
|
||||
curatorTab = await promoteStudioURL + 'curators';
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await clickXpath('//a[contains(@class, "user-info")]');
|
||||
await clickText('Sign out');
|
||||
await driver.get(curatorTab);
|
||||
await driver.sleep(1000);
|
||||
});
|
||||
|
||||
afterAll(async () => await driver.quit());
|
||||
|
||||
test('promote to manager', async () => {
|
||||
// sign in as user2
|
||||
await driver.get(rootUrl);
|
||||
await driver.sleep(1000);
|
||||
await signIn(username2, password, driver);
|
||||
await findByXpath('//span[contains(@class, "profile-name")]');
|
||||
|
||||
// Create a studio
|
||||
await driver.get(rateLimitCheck);
|
||||
await driver.get(myStuffURL);
|
||||
await clickXpath('//form[@id="new_studio"]/button[@type="submit"]');
|
||||
await findByXpath('//div[@class="studio-tabs"]');
|
||||
promoteStudioURL = await driver.getCurrentUrl();
|
||||
let curatorTab = await promoteStudioURL + 'curators';
|
||||
|
||||
// invite user3 to curate
|
||||
await driver.get(curatorTab);
|
||||
let inviteBox = await findByXpath('//div[@class="studio-adder-row"]/input');
|
||||
|
|
Loading…
Reference in a new issue