forked from oppia/oppia
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix part of oppia#17712 Add more acceptance tests for logged in users (…
…oppia#19991) * Footer navigation logged-in user tests progress * Click all buttons on get started page done * logged in users get started page test refactoring * click all about oppia footer buttons test working * Lint fixes * Lint fixes * Lint fixes * null-safety * Add /usr/bin/google-chrome-stable as possible CHROME_BIN path * click all about oppia footer buttons changes * Fix some flakiness for logged in user acceptance tests * Remove extra space * Matcher changes for logged-in-users-utils * Swap ` with \' on non-format string * Swaping a .toContain to a .toBe * Rename of some logged in user tests and restructuring of the click all likns on get started page spec
- Loading branch information
Showing
10 changed files
with
398 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
76 changes: 76 additions & 0 deletions
76
...-acceptance-tests/spec/logged-in-user-tests/click-all-links-in-about-oppia-footer.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
// Copyright 2024 The Oppia Authors. All Rights Reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS-IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
/** | ||
* @fileoverview Acceptance Test for checking if logged-in users can | ||
* navigate using all the links under the "About Oppia" footer section. | ||
*/ | ||
|
||
import {UserFactory} from '../../puppeteer-testing-utilities/user-factory'; | ||
import {LoggedInUser} from '../../user-utilities/logged-in-users-utils'; | ||
import testConstants from '../../puppeteer-testing-utilities/test-constants'; | ||
|
||
const DEFAULT_SPEC_TIMEOUT = testConstants.DEFAULT_SPEC_TIMEOUT; | ||
|
||
describe('Logged-in User', function () { | ||
let testUser: LoggedInUser; | ||
|
||
beforeAll(async function () { | ||
testUser = await UserFactory.createNewUser( | ||
'testuser', | ||
'[email protected]' | ||
); | ||
}, DEFAULT_SPEC_TIMEOUT); | ||
|
||
beforeEach(async function () { | ||
// Navigate to a page that has the oppia footer. | ||
await testUser.goto(testConstants.URLs.Volunteer); | ||
}); | ||
|
||
it( | ||
'should open About page via the footer', | ||
async function () { | ||
await testUser.navigateToAboutPageViaFooter(); | ||
}, | ||
DEFAULT_SPEC_TIMEOUT | ||
); | ||
|
||
it( | ||
'should open "About Foundation" page via the footer', | ||
async function () { | ||
await testUser.navigateToAboutFoundationPageViaFooter(); | ||
}, | ||
DEFAULT_SPEC_TIMEOUT | ||
); | ||
|
||
it( | ||
'should open "Blog" page via the footer', | ||
async function () { | ||
await testUser.navigateToBlogPageViaFooter(); | ||
}, | ||
DEFAULT_SPEC_TIMEOUT | ||
); | ||
|
||
it( | ||
'should open "Forum" page via the footer', | ||
async function () { | ||
await testUser.navigateToForumPageViaFooter(); | ||
}, | ||
DEFAULT_SPEC_TIMEOUT | ||
); | ||
|
||
afterAll(async function () { | ||
await UserFactory.closeAllBrowsers(); | ||
}); | ||
}); |
110 changes: 110 additions & 0 deletions
110
...er-acceptance-tests/spec/logged-in-user-tests/click-all-links-on-get-started-page.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
// Copyright 2024 The Oppia Authors. All Rights Reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS-IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
/** | ||
* @fileoverview Acceptance Test for checking if logged-in users | ||
* can open all the links on the "Get Started" page. | ||
*/ | ||
|
||
import {UserFactory} from '../../puppeteer-testing-utilities/user-factory'; | ||
import {LoggedInUser} from '../../user-utilities/logged-in-users-utils'; | ||
import testConstants from '../../puppeteer-testing-utilities/test-constants'; | ||
|
||
const DEFAULT_SPEC_TIMEOUT = testConstants.DEFAULT_SPEC_TIMEOUT; | ||
|
||
describe('Logged-in Users', function () { | ||
let testUser: LoggedInUser; | ||
|
||
beforeAll(async function () { | ||
testUser = await UserFactory.createNewUser( | ||
'testuser', | ||
'[email protected]' | ||
); | ||
}, DEFAULT_SPEC_TIMEOUT); | ||
|
||
it( | ||
'should be able to navigate to the Get Started page using the footer', | ||
async function () { | ||
await testUser.navigateToAboutFoundationPage(); | ||
await testUser.navigateToGetStartedPageViaFooter(); | ||
}, | ||
DEFAULT_SPEC_TIMEOUT | ||
); | ||
|
||
describe('on the Get Started page', function () { | ||
beforeEach(async function () { | ||
await testUser.navigateToGetStartedPage(); | ||
}, DEFAULT_SPEC_TIMEOUT); | ||
|
||
it( | ||
'should be able to use the "create one here" link', | ||
async function () { | ||
await testUser.clickCreateOneHereLinkInGetStartedPage(); | ||
}, | ||
DEFAULT_SPEC_TIMEOUT | ||
); | ||
|
||
it( | ||
'should be able to use the "Welcome to Oppia" link', | ||
async function () { | ||
await testUser.clickWelcomeToOppiaLinkInGetStartedPage(); | ||
}, | ||
DEFAULT_SPEC_TIMEOUT | ||
); | ||
|
||
it( | ||
'should be able to use the "Get Electrified!" link', | ||
async function () { | ||
await testUser.clickGetElectrifiedLinkInGetStartedPage(); | ||
}, | ||
DEFAULT_SPEC_TIMEOUT | ||
); | ||
|
||
it( | ||
'should be able to use the "Programming with Carla" link', | ||
async function () { | ||
await testUser.clickProgrammingWithCarlaLinkInGetStartedPage(); | ||
}, | ||
DEFAULT_SPEC_TIMEOUT | ||
); | ||
|
||
it( | ||
'should be able to use "in our user documentation" link', | ||
async function () { | ||
await testUser.clickInOurUserDocumentationLinkInGetStartedPage(); | ||
}, | ||
DEFAULT_SPEC_TIMEOUT | ||
); | ||
|
||
it( | ||
'should be able to use the "embed it in your own web page" link', | ||
async function () { | ||
await testUser.clickEmbedItInYourOwnWebPageLinkInGetStartedPage(); | ||
}, | ||
DEFAULT_SPEC_TIMEOUT | ||
); | ||
|
||
it( | ||
'should be able to use the "discover more ways to get involved" link', | ||
async function () { | ||
await testUser.clickDiscoverMoreWaysToGetInvolvedLinkInGetStartedPage(); | ||
}, | ||
DEFAULT_SPEC_TIMEOUT | ||
); | ||
|
||
afterAll(async function () { | ||
await UserFactory.closeAllBrowsers(); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.