mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-30 02:56:20 -05:00
Add integration tests loading scratch2 projects
Also update the readme with the info for
This commit is contained in:
parent
52ac678c53
commit
40ecc31704
2 changed files with 28 additions and 1 deletions
|
@ -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.
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue