diff --git a/README.md b/README.md index e62f1ba1c..0892e0d2a 100644 --- a/README.md +++ b/README.md @@ -233,6 +233,8 @@ Several environment variables need to be passed in for the tests to run. Most o * OWNED_SHARED_PROJECT_ID - ID for a shared project owned by [testuser]6. Used in the project-page tests. * UNOWNED_UNSHARED_PROJECT_ID - ID for an unshared project owned by [testuser]2. It is used in tests where it is opened by [testuser]6 in the project-page tests. * OWNED_UNSHARED_PROJECT_ID - ID for an unshared project owned by [testuser]6. It will be opened by its owner in the project-page tests. + * UNOWNED_SHARED_SCRATCH2_PROJECT_ID - ID for a shared scratch2 project owned by [testuser]2. It will be opened by [testuser]6. + * OWNED_UNSHARED_SCRATCH2_PROJECT_ID - ID for an unshared scratch2 project owned by [testuser]6. It will be opened by [testuser]6. * SAUCE_USERNAME - Username for a saucelabs account. Only used when running tests remotely with test:integration:remote * SAUCE_ACCESS_KEY - Access token used by the saucelabs account included. Only used when running tests remotely with test:integration:remote * SMOKE_REMOTE - Boolean to set whether to use saucelabs to run tests remotely. Set to true automatically when running tests with test:integration:remote, otherwise defaults to false. diff --git a/test/integration/project-page.test.js b/test/integration/project-page.test.js index 6c07bbd20..e7b97fee9 100644 --- a/test/integration/project-page.test.js +++ b/test/integration/project-page.test.js @@ -1,5 +1,6 @@ // These tests do not sign in with a user // Adding tests that sign in with user #6 +// some tests use projects owned by user #2 const SeleniumHelper = require('./selenium-helpers.js'); @@ -26,6 +27,12 @@ let ownedUnsharedUrl = rootUrl + '/projects/' + ownedUnsharedID; let unownedUnsharedID = process.env.UNOWNED_UNSHARED_PROJECT_ID || 1300006306; let unownedUnsharedUrl = rootUrl + '/projects/' + unownedUnsharedID; +let unownedSharedScratch2ID = process.env.UNOWNED_SHARED_SCRATCH2_PROJECT_ID || 1300009487; +let unownedSharedScratch2Url = rootUrl + '/projects/' + unownedSharedScratch2ID; + +let ownedUnsharedScratch2ID = process.env.OWNED_UNSHARED_SCRATCH2_PROJECT_ID || 1300009488; +let ownedUnsharedScratch2Url = rootUrl + '/projects/' + ownedUnsharedScratch2ID; + let username = process.env.SMOKE_USERNAME + '6'; let password = process.env.SMOKE_PASSWORD; @@ -135,7 +142,7 @@ describe('www-integration project-page signed in', () => { }); // Load an unshared project you own - test('Load a shared project you own', async () => { + test('Load an unshared project you own', async () => { await driver.get(ownedUnsharedUrl); let gfOverlay = await findByXpath('//div[@class="stage-wrapper_stage-wrapper_2bejr box_box_2jjDp"]'); await waitUntilVisible(gfOverlay, driver); @@ -151,4 +158,22 @@ describe('www-integration project-page signed in', () => { let unavailableVisible = await unavailableImage.isDisplayed(); await expect(unavailableVisible).toBe(true); }); + + // Load a shared scratch 2 project you don't own + test('Load a shared scratch 2 project you do not own', async () => { + await driver.get(unownedSharedScratch2Url); + let gfOverlay = await findByXpath('//div[@class="stage-wrapper_stage-wrapper_2bejr box_box_2jjDp"]'); + await waitUntilVisible(gfOverlay, driver); + let gfVisible = await gfOverlay.isDisplayed(); + await expect(gfVisible).toBe(true); + }); + + // Load an unshared scratch 2 project you own + test('Load an unshared scratch 2 project you own', async () => { + await driver.get(ownedUnsharedScratch2Url); + let gfOverlay = await findByXpath('//div[@class="stage-wrapper_stage-wrapper_2bejr box_box_2jjDp"]'); + await waitUntilVisible(gfOverlay, driver); + let gfVisible = await gfOverlay.isDisplayed(); + await expect(gfVisible).toBe(true); + }); });