oppia / oppia

A free, online learning platform to make quality education accessible for all.
https://www.oppia.org
Apache License 2.0
5.74k stars 3.89k forks source link

Write e2e tests for all functional capabilities #6240

Closed nithusha21 closed 1 year ago

nithusha21 commented 5 years ago

This project is aimed at writing e2e (end-to-end) tests for all functional capabilities. See this wiki page for information on e2e testing principles at Oppia. The general procedure to write such tests is as follows:

A few general guidelines while writing such tests:

PR's for reference: #8571 , #8639

To be assigned to a file or for any queries, comment on the thread and tag @U8NWXD .

To get started, ask to be assigned to any unclaimed task. Tasks are claimed by adding the username of the claimer to the end of the task, e.g. @example.

Unclaimed Tasks

Interactions

Less Important Interactions

Claimed Tasks

Admin Page (adminTab.js)

To access the admin page (note this only works when running Oppia locally):

  1. Login to Oppia, selecting the checkbox to make yourself an administrator when you enter an email address
  2. Open the main menu by hovering over your profile picture in the upper-right corner and select Admin Page
  3. Select the tab you are writing tests for, for example MISC

For examples of existing admin page tests, check out core/tests/protractor_desktop/adminTabFeatures.js.

Play Audio Translations

Blocked Tasks

Review Tests

To run a review test:

  1. Create a topic
  2. In that topic, create a story
  3. Create story nodes
  4. Go to /story/<story_id> to complete the story nodes
  5. You should see a review test every 3 nodes

Practice Sessions

To run a practice session:

  1. Create a topic
  2. Assign some skills to the topic
  3. Create some questions and link them to those skills
  4. Go to /practice_session/<topic_name> to see the practice session

Stats Modal

Assigning Super-Admin Privileges

Need to check with brianrodri, who wrote the dashboard

Resolved Tasks

List of resolved part of this issue: - [x] One-off jobs should be visible and runnable from the jobs tab. @Showtim3 - Creator Dashboard (creatorDashboard.js) - [x] The various tabs on the creator dashboard (exploration, collection, etc) are displayed with correct data when the user has created an exploration, collection, etc. @bansalnitish - [x] Add subject interests in the preferences page @nipan09 - [x] View number of created explorations @LanJosh - [x] (Easy) Mark correct answers after enabling correctness feedback @nuajen. - [x] Assigning and viewing of roles should be possible in the roles tab. @Showtim3 - [x] The stats shown on the creator dashboard update correctly. @bansalnitish #7491 - [x] (Easy) The list view and the grid view on the creator dashboard work correctly. @bansalnitish - [x] (Easy) View explorations created by another user on their profile page - @marianazangrossi - [x] (Easy) View personal details of user (profile picture, bio, subject interests) - @U8NWXD - Exploration player features - [x] Suggest a change to an exploration @Showtim3 - [x] Explorations marked as play later are accessible under the “play later” tab of the learner dashboard. (learnerDashboard.js) @Showtim3 - [x] Revert to an old commit in an exploration (explorationHistoryTab.js) @sagangwee - [x] Report an exploration (additionalEditorAndPlayerFeatures.js) @Showtim3 - [x] Save an exploration to play later list (publicationAndLibrary.js) @Showtim3 - [x] Subscribe to the user (profileFeatures.js) @apb7 (already covered in subscriptionFlow.js) - [x] Create and edit questions linked to any of the skills in the topic. @aks681 - [x] Add description to story @aks681 - [x] Edit title of story @aks681 - [x] Edit story notes @aks681 - [x] Add concept card contents @aks681 - [x] Change skill description @aks681 - [x] Add worked examples and misconceptions @aks681 - [x] Create and edit questions linked to the skill @aks681 - [x] Create a subtopic @aks681 - [x] Edit subtopic page contents @aks681 - [x] Delete subtopic @aks681 - [x] Edit exploration properties (title, category, goal, language, etc) (coreEditorAndPlayerFeatures.js) @sophiewu6 (https://github.com/oppia/oppia/pull/6557) - [x] Add a bio to your profile (preferences.js) @yesass (https://github.com/oppia/oppia/pull/6512) - [x] Add exploration specific roles to users (coreEditorAndPlayerFeatures.js) (note: test already exists) - Preferences (preferences.js) - [x] (Easy) Set your preferred dashboard - @hareshkh #7503 - [x] (Easy) Change preferred site or audio language - @bansalnitish #7456 - [x] Upload a profile picture @U8NWXD - Exploration editor tabs (explorationFeedbackTab.js) - [x] (Easy) Message on a feedback thread @bansalnitish #7495 - [x] (Easy) Change status of a feedback thread @bansalnitish #7484 - Profile features (profileFeatures.js) - [x] (Easy) The navigation (using next and back buttons) works correctly in an exploration. - @nishantwrp - New structures - [x] Create, edit and delete chapters - @cuichenli - Harder tests to write due to issues like file upload, one-off jobs etc: - [x] Move skill between subtopics and remove from topic (see #6404 for more details) @U8NWXD - [x] Add audio translations for the state content - @piotrhm - Interactions - [x] Code Editor Interaction (`/extensions/interactions/CodeRepl/protractor.js`) @rohitkatlaa - [x] Item Selection Interaction (`/extensions/interactions/ItemSelectionInput/protractor.js`) @nadintamer
nishikeshKardak commented 5 years ago

Can I working on it ?

DubeySandeep commented 5 years ago

Hi @nishikeshKardak, Yeah you can work on a part of this issue. let me know which part you would fix so that I can go ahead and assign you? Thanks! :)

nishikeshKardak commented 5 years ago

Hey @DubeySandeep Thanks for quick reply. I'm new to writing test cases. Now I want to working on creating, editing and deleting chapters. Please assign me this, after completing this tests I will work on further tests. Thank you! :)

anubhavsinha98 commented 5 years ago

Hi @nishikeshKardak, assigned you. Go ahead!

nishikeshKardak commented 5 years ago

Thanks @anubhavsinha98 :)

ay11111111111 commented 5 years ago

Hi! Is there any sample of a test? I am a newbie, so I am not sure about solution)

ay11111111111 commented 5 years ago

Ok, I have read wiki about e2e tests. Can I make a test for Adding a bio in profile?

anubhavsinha98 commented 5 years ago

Ok @yesass, assigning you the same!

varun-tandon commented 5 years ago

Could I please try Upload a profile picture (preferences.js)

anubhavsinha98 commented 5 years ago

Hi @varun-tandon, assigning you. Go ahead :)

ay11111111111 commented 5 years ago

@anubhavsinha98 I have a problem when running e2e tests related to bower. Have written about it to the chat, but nobody replies to me. Can you help me, please?

anubhavsinha98 commented 5 years ago

Hi @yesass, have you installed chrome/chromium on your local setup?

ay11111111111 commented 5 years ago

@anubhavsinha98 yes, chrome is installed

apoorv1997 commented 5 years ago

Hi, i would like to work on create dashboard functionality @aks681

aks681 commented 5 years ago

I've assigned you to it. Go ahead!

apoorv1997 commented 5 years ago

Can i start working on profile features?

ay11111111111 commented 5 years ago

Hi! Could you review my PR? Did I make a PR right?) https://github.com/oppia/oppia/pull/6512

DubeySandeep commented 5 years ago

@nishikeshKardak, any update on the assigned issue?

nishikeshKardak commented 5 years ago

@DubeySandeep please unassigned this issue for me. I'm currently working on backend tests.

DubeySandeep commented 5 years ago

@nishikeshKardak, Thanks for the update, I've unassigned your from this issue.

nishikeshKardak commented 5 years ago

Thanks @DubeySandeep :)

sophiewu6 commented 5 years ago

Hi, can I take Edit exploration properties (title, category, goal, language, etc) (coreEditorAndPlayerFeatures.js)?

DubeySandeep commented 5 years ago

Hi @sophiewu6, I've assigned you to Edit exploration properties part of this issue, you can start working on it. Thanks!

varun-tandon commented 5 years ago

@DubeySandeep can you please remove me from preferences.js?

Thanks!

DubeySandeep commented 5 years ago

@varun-tandon, Thanks for the update, I've unassigned you from preferences.js part of this issue.

sagangwee commented 5 years ago

Hi, I'd like to take the 2nd task: "Explorations marked as play later are accessible under the “play later” tab of the learner dashboard. (learnerDashboard.js)" Thanks!

seanlip commented 5 years ago

Thanks @sagangwee, sounds good :) Assigned you!

Showtim3 commented 5 years ago

@seanlip hey Sean but isn't that(Explorations marked as play later are accessible under the “play later” tab of the learner dashboard. (learnerDashboard.js)) and the topmost issue supposed to be tested together? I am asking because i was working on the topmost test.

seanlip commented 5 years ago

Hi @Showtim3, it seems reasonable to test them together, but you don't seem to have been assigned and there's no indication of that. Next time, if you're working on something, please make sure to assign yourself (or ask someone else to do so) so that we don't run into this situation.

Could you discuss with @sagangwee and figure out what each of you would like to work on? Then, maybe one of you could reply here and we can update the assignments accordingly.

Thanks!

Showtim3 commented 5 years ago

@sagangwee hey buddy, my bad. I didn't assign myself to the issue( Save an exploration to play later list (publicationAndLibrary.js)) and I started working on it without any indication(so sorry for this). I am almost done with the test and it also covers the test on which you are working. If you have spent some time or are close to completing your assigned test or are really interested in that particular test, I can probably help out with another one. It's totally your call. Thanks!

sagangwee commented 5 years ago

Hi @Showtim3, I was close to completing the test, but if you were almost done with it as well, then no worries, I can find another test to work on. I've gotten more familiar with the testing framework and learner flow, so it was still time well spent. :)

sagangwee commented 5 years ago

Hi, I'd like to take the 5th from bottom task: "Add exploration specific roles to users (coreEditorAndPlayerFeatures.js)". Thanks!

seanlip commented 5 years ago

OK, I think I've assigned y'all to the correct things :) Please let me know if that's not the case and we can fix it.

Thank you both for being flexible!

Showtim3 commented 5 years ago

@sagangwee Hi, I deeply apologize for the trouble I've caused you. I am really sorry and Thanks for being so cool about it. I am much grateful. Thanks a lot.

sagangwee commented 5 years ago

Hi I think the "Add exploration specific roles to users (coreEditorAndPlayerFeatures.js)" task is covered by the "Permissions for private explorations" tests in core/tests/protractor_desktop/publicationAndLibrary.js?

seanlip commented 5 years ago

/cc @nithusha21 -- could you advise on @sagangwee's question please? Thanks!

nithusha21 commented 5 years ago

Hi @sagangwee I think you are right! The tests there do check the role assignment. Would you like to pick another user journey instead? (I'll mark this as done)

sagangwee commented 5 years ago

@nithusha21 Sure, I'll take "Revert to an old commit in an exploration (explorationHistoryTab.js)" then. Thanks!

seanlip commented 5 years ago

Thanks @sagangwee ! Reassigned you.

sagangwee commented 5 years ago

Hi I think "Revert to an old commit in an exploration (explorationHistoryTab.js)" is also covered by the "should display the history" test (line 539) in core/tests/protractor_desktop/explorationHistoryTab.js?

seanlip commented 5 years ago

Assigning @LanJosh to "View number of created explorations (profileFeatures.js)"

seanlip commented 5 years ago

Hi @sagangwee, yes, I agree!

That said, it is a bit buried. Any chance you could split it out into a separate e2e test? I think that's why this was missed in the initial accounting.

sagangwee commented 5 years ago

@seanlip Sure thing!

nipan09 commented 5 years ago

Hi! I am a newbie to open source. I would like to work on adding the subject interests in preferences. Where can I find the code regarding this? Can you assign me this issue?

kevinlee12 commented 5 years ago

@nipan09, welcome! You can find the code here in preferences.js. I've assigned you that section.

nipan09 commented 5 years ago

Thank you @kevinlee12 for assigning me this issue. I will let the community know about my progress.

nithusha21 commented 5 years ago

Hi @LanJosh any updates on this issue?

U8NWXD commented 5 years ago

Hi, I'd like to take the task:

View personal details of user (profile picture, bio, subject interests)

Thanks!

kevinlee12 commented 5 years ago

@U8NWXD, you got it!

seanlip commented 5 years ago

Assigned @hareshkh to "Set your preferred dashboard" (in Preferences page)