Skip to content

Commit

Permalink
Fix part of #17712 Add more acceptance tests for logged in users (#20126
Browse files Browse the repository at this point in the history
)

* 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

* Click all links on creator guidelines page acceptance test

* More logged-in user test progress

* Logged in user tests for teach and terms pages

* logged-in-user-utils constant changes

* Logged-in users Social icons and privacy page tests

* Fix linter errors

* Last logged-in users test

* remove duplicate member from logged-in-user-utils

* logged in user test documentation updates

* fix broken acceptance test, logged-in-user-tests/click-all-links-on-get-started-page

* Attempt to lower flakiness of following links to social media sites

* Remove extra dash in acceptance suite name

* Fix typos in logged-in-user-tests

* Footer icon click functions renames

* Add missing function documentation

* Remove some empty lines

* Add new test suite

* move tests into click-all-links-in-teach-learn-footer spec

* Rename some logged-in-user-util functions

* fix logged-in-user-tests/click-all-buttons-on-teach-page.spec.ts

* Add test for Google Play button

* Fix typo

* Renaming symbols and more test reshuffling

* move some constants to test-contants.ts

* move some constants to test-contants.ts

* fix incorrect named symbol

* Replace tests that where accidentaly removed when merging

* Add test to click Privacy Policy link on terms page

* More logged in test changes

* Change domain for twitter

* Fix symbols for logged-out-user tests

* minor documentation change ('logged-in' -> 'logged-out')

* Remove teach page acceptance test on this branch since it exists in develop already

* Merge oppia footer tests into one file

* fix linter issues

* Fix footer test flake

* uncomment out test

* fix acceptance test flakes

* rename click-all-links-in-terms-page test to click-all-links-on-terms-page

* remove extra function declaration

---------

Co-authored-by: Hardik Goyal <135348086+HardikGoyal2003@users.noreply.github.com>
  • Loading branch information
agallop and HardikGoyal2003 committed Jun 22, 2024
1 parent 6ea9212 commit 58c14ca
Show file tree
Hide file tree
Showing 14 changed files with 803 additions and 119 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,11 @@ jobs:
- logged-out-user/click-all-buttons-on-partnerships-page
- logged-out-user/click-all-buttons-on-teach-page
- logged-out-user/click-all-buttons-on-volunteer-page
- logged-out-user/click-all-links-in-about-oppia-footer
- logged-out-user/click-all-links-in-terms-page
- logged-out-user/click-all-links-in-oppia-footer
- logged-out-user/click-all-links-on-creator-guidelines-page
- logged-out-user/click-all-links-on-get-started-page
- logged-out-user/click-all-links-on-privacy-policy-page
- logged-out-user/click-all-links-on-terms-page
- moderator/edit-featured-activities-list
- moderator/view-recent-commits-and-feedback-messages
- practice-question-admin/add-and-remove-contribution-rights
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ <h1>Privacy Policy</h1>
mission, Oppia (also "we" or "us") collects some information from its
users to deliver an interactive and engaging experience. This Privacy
Policy describes the types of information we collect from users of the
Oppia website (<a href="https://www.oppia.org">https://www.oppia.org</a>)
Oppia website (<a href="/">https://www.oppia.org</a>)
(the "Site") and how Oppia collects, uses, discloses, and protects that
information. By using the Site or providing Personal Information (as
defined below) to us, you agree to this Privacy Policy.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe('Donor', function () {
// Navigating back to home page for the next test.
await loggedOutUser.navigateToHome();
// Navigating to about foundation page via footer from home page.
await loggedOutUser.navigateToAboutFoundationPageViaFooter();
await loggedOutUser.clickOnTheOppiaFoundationLinkInFooter();

// Navigating to donate page by clicking on the "donations" link on the about foundation page.
await loggedOutUser.clickDonationsLinkInAboutFoundation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe('Parent/Teacher', function () {
'and click on "Explore Lessons" button',
async function () {
// Navigating to "For Parent/Teacher page" via footer from home page.
await loggedOutUser.navigateToTeachPageViaFooter();
await loggedOutUser.clickOnForParentsSlashTeachersLinkInFooter();
// Navigating to lessons/classroom page by clicking on the
// "Explore Lessons" button on the "For Parent/Teacher" page.
await loggedOutUser.clickExploreLessonsButtonInTeachPage();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('Partner', function () {
// Navigating back to home page for the next test.
await loggedOutUser.navigateToHome();
// Navigating to about foundation page via footer from home page.
await loggedOutUser.navigateToAboutFoundationPageViaFooter();
await loggedOutUser.clickOnTheOppiaFoundationLinkInFooter();

// Navigating to partnerships page by clicking on "Consider becoming a partner today" link on the about foundation page.
await loggedOutUser.clickConsiderBecomingAPartnerTodayLinkInAboutFoundation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe('Volunteer', function () {
// Navigating back to home page for the next test.
await loggedOutUser.navigateToHome();
// Navigating to about foundation page via footer from home page.
await loggedOutUser.navigateToAboutFoundationPageViaFooter();
await loggedOutUser.clickOnTheOppiaFoundationLinkInFooter();

// Navigating to the Volunteer page by clicking on the "Become a Volunteer" button.
await loggedOutUser.clickBecomeAVolunteerButtonInAboutFoundation();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
// 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-out users can
* navigate using all the links under the "About Oppia" footer section.
*/

import {UserFactory} from '../../utilities/common/user-factory';
import testConstants from '../../utilities/common/test-constants';
import {LoggedOutUser} from '../../utilities/user/logged-out-user';

const DEFAULT_SPEC_TIMEOUT_MSECS = testConstants.DEFAULT_SPEC_TIMEOUT_MSECS;

describe('Logged-out Users', function () {
let loggedOutUser: LoggedOutUser;

beforeAll(async function () {
loggedOutUser = await UserFactory.createLoggedOutUser();
}, DEFAULT_SPEC_TIMEOUT_MSECS);

beforeEach(async function () {
// Navigate to a page that has the oppia footer.
await loggedOutUser.navigateToHome();
}, DEFAULT_SPEC_TIMEOUT_MSECS);

it(
'should open "Donate" page via the footer',
async function () {
await loggedOutUser.clickOnDonateLinkInFooter();
},
DEFAULT_SPEC_TIMEOUT_MSECS
);

it(
'should open the "Volunteer" page via the footer',
async function () {
await loggedOutUser.clickOnVolunteerLinkInFooter();
},
DEFAULT_SPEC_TIMEOUT_MSECS
);

it(
'should open "About" page via the footer',
async function () {
await loggedOutUser.clickOnAboutLinkInFooter();
},
DEFAULT_SPEC_TIMEOUT_MSECS
);

it(
'should open "About Foundation" page via the footer',
async function () {
await loggedOutUser.clickOnAboutLinkInFooter();
},
DEFAULT_SPEC_TIMEOUT_MSECS
);

it(
'should open "Blog" page via the footer',
async function () {
await loggedOutUser.clickOnBlogLinkInFooter();
},
DEFAULT_SPEC_TIMEOUT_MSECS
);

it(
'should open "Forum" page via the footer',
async function () {
await loggedOutUser.clickOnForumLinkInFooter();
},
DEFAULT_SPEC_TIMEOUT_MSECS
);

it(
'should open "Get Started" page via the footer',
async function () {
await loggedOutUser.clickOnGetStartedLinkInFooter();
},
DEFAULT_SPEC_TIMEOUT_MSECS
);

it(
'should open "Creator Guidelines" page via the footer',
async function () {
await loggedOutUser.clickOnCreatorGuidelinesLinkinFooter();
},
DEFAULT_SPEC_TIMEOUT_MSECS
);

it(
'should open "Teach" page via the footer',
async function () {
await loggedOutUser.clickOnForParentsSlashTeachersLinkInFooter();
},
DEFAULT_SPEC_TIMEOUT_MSECS
);

it(
'should open "Community Library" page via the footer',
async function () {
await loggedOutUser.clickOnBrowseTheLibraryLinkInFooter();
},
DEFAULT_SPEC_TIMEOUT_MSECS
);

it(
'should open "Contact" page via the footer',
async function () {
await loggedOutUser.clickOnContactUsLinkInFooter();
},
DEFAULT_SPEC_TIMEOUT_MSECS
);

it(
'should be able to visit the Oppia YouTube',
async function () {
await loggedOutUser.clickYouTubeIconInFooter();
},
DEFAULT_SPEC_TIMEOUT_MSECS
);

it(
'should be able to visit the Oppia Facebook',
async function () {
await loggedOutUser.clickFacebookIconInFooter();
},
DEFAULT_SPEC_TIMEOUT_MSECS
);

it(
'should be able to visit the Oppia Instagram',
async function () {
await loggedOutUser.clickInstagramIconInFooter();
},
DEFAULT_SPEC_TIMEOUT_MSECS
);

it(
'should be able to visit the Oppia Twitter',
async function () {
await loggedOutUser.clickTwitterIconInFooter();
},
DEFAULT_SPEC_TIMEOUT_MSECS
);

it(
'should be able to visit the Oppia Github',
async function () {
await loggedOutUser.clickGithubIconInFooter();
},
DEFAULT_SPEC_TIMEOUT_MSECS
);

it(
'should be able to visit the Oppia LinkedIn',
async function () {
await loggedOutUser.clickLinkedInIconInFooter();
},
DEFAULT_SPEC_TIMEOUT_MSECS
);

it(
'should be able to visit the Oppia Google Play page',
async function () {
await loggedOutUser.clickGooglePlayButtonInFooter();
},
DEFAULT_SPEC_TIMEOUT_MSECS
);

it(
'should open "Terms of Service" page via the footer',
async function () {
await loggedOutUser.clickOnTermsOfServiceLinkInFooter();
},
DEFAULT_SPEC_TIMEOUT_MSECS
);

it(
'should open "Privacy Policy" page via the footer',
async function () {
await loggedOutUser.clickOnPrivacyPolicyLinkInFooter();
},
DEFAULT_SPEC_TIMEOUT_MSECS
);

afterAll(async function () {
await UserFactory.closeAllBrowsers();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
// 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-out users
* can open all the links on the "Creator Guidelines" page.
*/

import {UserFactory} from '../../utilities/common/user-factory';
import testConstants from '../../utilities/common/test-constants';
import {LoggedOutUser} from '../../utilities/user/logged-out-user';

const DEFAULT_SPEC_TIMEOUT = testConstants.DEFAULT_SPEC_TIMEOUT_MSECS;

describe('Logged-out Users', function () {
let testUser: LoggedOutUser;

beforeAll(async function () {
testUser = await UserFactory.createNewUser(
'testuser',
'testuser@example.com'
);
}, DEFAULT_SPEC_TIMEOUT);

beforeEach(async function () {
await testUser.navigateToCreatorGuidelinesPage();
}, DEFAULT_SPEC_TIMEOUT);

it(
'should be able to use the "forum" link',
async function () {
await testUser.clickForumLinkOnCreatorGuidelinesPage();
},
DEFAULT_SPEC_TIMEOUT
);

it(
'should be able to use the "Design Tips" link',
async function () {
await testUser.clickDesignTipsLinkOnCreatorGuidelinesPage();
},
DEFAULT_SPEC_TIMEOUT
);

it(
'should be able to use the "Create an Exploration" link',
async function () {
await testUser.clickCreateAnExplorationLinkOnCreatorGuidelinesPage();
},
DEFAULT_SPEC_TIMEOUT
);

it(
'should be able to use the "Browse our Expectations" link',
async function () {
await testUser.clickBrowseOurExpectationsLinkOnCreatorGuidelinesPage();
},
DEFAULT_SPEC_TIMEOUT
);

afterAll(async function () {
await UserFactory.closeAllBrowsers();
});
});
Loading

0 comments on commit 58c14ca

Please sign in to comment.