oppia / oppia

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

Acceptance Testing - covering all user journeys in form of user stories #17712

Open Shivkant-Chauhan opened 1 year ago

Shivkant-Chauhan commented 1 year ago

Describe the bug

In order to verify that key user journeys do not break, the Oppia development team is implementing Acceptance Testing for the develop branch. This means that, on every commit, all key requirements are verified through a set of acceptance tests that check that each type of end user can do the things they expect to do on the site.

The aim of this issue is to build up a set of such tests. Please see the instructions below for how to claim a task in this issue. (Feel free to contact @oppia/acceptance-test-reviewers if you have any doubts!)

# Instructions

  1. Carefully read the “How to write Acceptance Tests” wiki page.
  2. Select 1 or more “package” (of 1-2 user stories each) from the list below, and get yourself assigned to them from @oppia/acceptance-test-reviewers
  3. After the user stories are assigned to you, go to the user file for the tests inside core/tests/puppeteer-acceptance-tests/spec/<user-type>tests.spec.js
  4. Start writing the assigned user stories based on the Testing Spreadsheet. Each user story in the spreadsheet should be covered within 1 it block, and all the test steps and expectations should match the expected behavior. You might also need to write utility functions, similar to the existing examples below.
  5. After you have written the tests, make sure they run fine on your local machine before submitting your PR. If this is your first time writing acceptance tests, we suggest writing the tests for one user story and verifying that it runs fine before adding the rest of the tests to your PR.
  6. In case of any confusion or for PR reviews, feel free to ask @oppia/acceptance-test-reviewers
  7. After getting assigned to a package(containing 2-3 user stories), your inactivity/no communication for more than 7 days may lead to getting unassigned from the task assigned.

For reference: You can see an example set of acceptance tests for “blog admin”/”blog editor” here. Please follow a similar format and file naming convention for the tests that you write:

List of user stories (arranged by user type)

(serial numbers same as testing spreadsheet row number for each user type)

Exploration Creator

Contributor Dashboard

Logged-in Learner @AFZL210

Anonymous Learner

Logged-in user (browsing static pages)

Topic Manager

github-actions[bot] commented 1 year ago

Hi @Shivkant-Chauhan, thanks for proposing this as a good first issue. I am removing the label for now and looping in @DubeySandeep to approve the label. It will be added back if approved. Thanks!

github-actions[bot] commented 1 year ago

Hi @Shivkant-Chauhan, thanks for proposing this as a good first issue. I am removing the label for now and looping in @DubeySandeep to approve the label. It will be added back if approved. Thanks!

caramelmelmel commented 1 year ago

Hi @ashish-patwal and @Shivkant-Chauhan can I get 7 and 8 of exploration creator assigned to me? thank you! since it's my first time writing such acceptance testing, i might need some time or guidance on this aspect.

  1. As a pre-requisite, does my browser need to redirect to the /creator-dashboard route?
  2. If there are bugs encountered in the code that is to be tested, do I flag or fix the developed code bugs?
  3. Also, having done some user testing, can I suggest some UX changes? One example is the placing of the icons that may be unintuitive Thank you!
Shivkant-Chauhan commented 1 year ago

Hi @ashish-patwal and @Shivkant-Chauhan can I get 7 and 8 of exploration creator assigned to me? thank you! since it's my first time writing such acceptance testing, i might need some time or guidance on this aspect.

  1. As a pre-requisite, does my browser need to redirect to the /creator-dashboard route?
  2. If there are bugs encountered in the code that is to be tested, do I flag or fix the developed code bugs?
  3. Also, having done some user testing, can I suggest some UX changes? One example is the placing of the icons that may be unintuitive Thank you!

Hey @caramelmelmel, assigned you to the 7,8 user stories of exploration creator and thanks for showing your interest in the Acceptance tests. I and @ashish-patwal will be there for you for clearing your blockers and helping you out when stuck. But get a fair idea by reading the wiki pages for Acceptance tests and go through the reference PR #16394 (links are shared within the issue desc.).

1 --> yes, you need to have the local server setup on your system and you must be accessible to the /creator-dashboard page. also, you need to have a proper idea of all the components present on the page and what must be the expected behavior of the components (if there is a bug anywhere). 2 --> if you are able to fix the bug within the PR itself, that would be very appreciable. otherwise, you need to open an issue for the bug you encountered with proper desc. 3 --> it depends if your idea seems good to the product reviewers, then we can implement your suggested changes.

marcella-stefan commented 1 year ago

Hello @ashish-patwal and @Shivkant-Chauhan, it's my first time contributing to an open source software and I would like to get assigned to (5,6) Exploration Creator or/and Anonymous Learner(3,4)?

Shivkant-Chauhan commented 1 year ago

Hello @ashish-patwal and @Shivkant-Chauhan, it's my first time contributing to an open source software and I would like to get assigned to (5,6) Exploration Creator or/and Anonymous Learner(3,4)?

hey @marcella-stefan , since you are new to the codebase, so I am assigning you only 1 package from Exploration Creator. Please ask here in case of any blocker/confusion.

Shivkant-Chauhan commented 1 year ago

@caramelmelmel please share the updates on the package you are assigned.

SahilB1 commented 1 year ago

Hi @Shivkant-Chauhan and @ashish-patwal, this is my first time contributing to an open source project as well, would I be able to get assigned to Logged-in user browsing static pages (3, 11)?

Shivkant-Chauhan commented 1 year ago

Hi @Shivkant-Chauhan and @ashish-patwal, this is my first time contributing to an open source project as well, would I be able to get assigned to Logged-in user browsing static pages (3, 11)?

sure @SahilB1 ! assigning you to the requested package.

SahilB1 commented 1 year ago

@Shivkant-Chauhan Thank you! Will the acceptance tests wiki page have the information needed to get started on understanding how to go about writing these tests?

SahilB1 commented 1 year ago

@Shivkant-Chauhan @ashish-patwal I tried to run the acceptance tests as they are using the command python -m scripts.run_acceptance_tests from my root directory of oppia, but I'm getting a No module named scripts.run_acceptance_test error when I try to run the command.

Additionally, running jasmine --config="core/tests/puppeteer-acceptance-tests/jasmine.json" core/tests/puppeteer-acceptance-tests/spec/blog-editor-tests/check-blog-editor-unable-to-publish-duplicate-blog-post.spec.js as the example test in the acceptance test page yields the response

Running suite with 0 specs. No specs found Finished in 0.002 seconds Incomplete: No specs found

Looking into the actual scripts directory in my cloned repo, it looks like run_acceptance_test.py does not exist in this directory. Could it have moved elsewhere or have been renamed?

Shivkant-Chauhan commented 1 year ago

@Shivkant-Chauhan @ashish-patwal I tried to run the acceptance tests as they are using the command python -m scripts.run_acceptance_tests from my root directory of oppia, but I'm getting a No module named scripts.run_acceptance_test error when I try to run the command.

Additionally, running jasmine --config="core/tests/puppeteer-acceptance-tests/jasmine.json" core/tests/puppeteer-acceptance-tests/spec/blog-editor-tests/check-blog-editor-unable-to-publish-duplicate-blog-post.spec.js as the example test in the acceptance test page yields the response

Running suite with 0 specs. No specs found Finished in 0.002 seconds Incomplete: No specs found

Looking into the actual scripts directory in my cloned repo, it looks like run_acceptance_test.py does not exist in this directory. Could it have moved elsewhere or have been renamed?

we are still having a PR opened on that (#17364 ) that will fix both the things you asked for. for now, run tests with: jasmine --config=core/tests/puppeteer-acceptance-tests/jasmine.json --filter="Blog Editor" As soon as the above PR is merged, all the things will be running smoothly as stated in the wiki pages.

SahilB1 commented 1 year ago

@Shivkant-Chauhan sounds good, thank you!

caramelmelmel commented 1 year ago

Thanks for the response! I'm also experiencing the same issue! In the meantime, could we copy the PR that fixes #17364 to run the acceptance tests?

Shivkant-Chauhan commented 1 year ago

@caramelmelmel @SahilB1 until the PR #17364 is not merged, please run the test using: jasmine --config=core/tests/puppeteer-acceptance-tests/jasmine.json --filter="Blog Admin" command in your root /oppia directory

caramelmelmel commented 1 year ago

sure! thank you so much! right now, I'm asking for signed in users wise, must I mock the sign in phase?

SahilB1 commented 1 year ago

@Shivkant-Chauhan Thank you! Would you happen to have an idea or estimate as to when PR #17364 might be merged? No worries if not, just curious.

Shivkant-Chauhan commented 1 year ago

@SahilB1 We are making it asap. but it might not be a blocker for you!.. you can start writing tests by referring to the wiki and the already written tests. also just to run your test, use jasmine --config=core/tests/puppeteer-acceptance-tests/jasmine.json --filter="{{your suite name}}"

SahilB1 commented 1 year ago

@Shivkant-Chauhan Perfect, I'll be sure to do so. Thanks!

jjxiong23 commented 1 year ago

Hi @Shivkant-Chauhan and @ashish-patwal, can I get the Practice Question Reviewer (5.1 and 5.2) of Contributor Dashboard assigned to me? I'm a college student and looking to contribute to an open source project as part of a class I'm taking right now. Thank you!

noramark commented 1 year ago

Hi @Shivkant-Chauhan and @ashish-patwal, Could I possibly be assigned to Practice Question Admin 6.1 and 6.2? I'm also a college student and a first time contributor to an open source project. Thank you!

Shivkant-Chauhan commented 1 year ago

@jjxiong23 @noramark done!

maxliu2001 commented 1 year ago

Hello @Shivkant-Chauhan and @ashish-patwal, I'm wondering if I can be assigned to Logged-in learner (3,4)? I'm a first time contributor to an open source project and I'm taking a class in my college that asks me to contribute to an open source project. Thank you!

SACHARYAS commented 1 year ago

Hi @Shivkant-Chauhan and @ashish-patwal, I'm a cs student and have a open source project as a class final project. can I get the Practice Question submitter (4.1 and 4.2) of Contributor Dashboard assigned to me?

Shivkant-Chauhan commented 1 year ago

@maxliu2001 @SACHARYAS done!

katehrkim commented 1 year ago

Hi @ashish-patwal and @Shivkant-Chauhan can I get 5 and 6 of logged in learned assigned to me? thank you!

michbyiri commented 1 year ago

Hi, @ashish-patwal and @Shivkant-Chauhan can I get 4 or 9 of Exploration Creator assigned to me? Thank you!

aashanp01 commented 1 year ago

Hi @ashish-patwal and @Shivkant-Chauhan, just following up to see if we can get these tasks assigned to us, thanks!

Hi, @ashish-patwal and @Shivkant-Chauhan can I get 4 or 9 of Exploration Creator assigned to me? Thank you!

suraj-mandal commented 1 year ago

HI @ashish-patwal and @Shivkant-Chauhan . I am new to the codebase and intereseted in contributing to the project. Can I get some of the user stories assigned to me? Thanks a lot!

Shivkant-Chauhan commented 1 year ago

@katehrkim @michbyiri @suraj-mandal I have assigned each of you with a package. PTAL!

Shivkant-Chauhan commented 1 year ago

@SahilB1 @caramelmelmel @noramark @jjxiong23 can you please update me with the user stories you are working on.

noramark commented 1 year ago

Hi @Shivkant-Chauhan currently working on the practice question admin story - ensuring the admin can provide a user with contribution rights (being able to review and submit a question) - For updates generally, is there specific information I should be providing or updating with?

jjxiong23 commented 1 year ago

Hi @Shivkant-Chauhan, I'm also currently working on writing the acceptance tests for practice question reviewers. Starting with the first user story (accepting a question on a topic), and then will move on to the second user story (rejecting a question on a topic). Seconding @noramark, how should we keep you updated as we work on these tests?

SahilB1 commented 1 year ago

Hi @Shivkant-Chauhan, I'm currently working on writing the acceptance tests for logged-in users navigating to static pages via the navbar and footer sitemap to ensure that the users are navigating to the correct pages when clicking on the links to these static pages.

suraj-mandal commented 1 year ago

Hi! @Shivkant-Chauhan, I was trying to run the acceptance test using the command

python -m scripts.run_acceptance_tests

However, I am getting the given error:

/home/suraj-mandal/Desktop/suraj-work/OSPs/oppia/.direnv/python-3.8.15/bin/python: No module named scripts.run_acceptance_tests

When I checked thescripts directory I found that there is no such script with the given name. I have installed and configured Oppia as per the instructions presented in the installation page.

Can you help me figure out how exactly the acceptance tests can be run?

My OS is Ubuntu 22.04.

suraj-mandal commented 1 year ago

Here, I tried running the server first at localhost:8181. Then I am executing the jasmine script. But getting the error.

Since I am new to tests, I need to know if I am proceeding correctly or not.

Getting this error: image

Here is the full stack trace image

suraj-mandal commented 1 year ago

Can someone help me with configuring Jasmine for e2e testing... I have been trying since yesterday, unable to make any progress

michbyiri commented 1 year ago

Hi, @ashish-patwal and @Shivkant-Chauhan, we finished writing the acceptance test for exploration creator 4, and we are just wondering where do we submit our code for review? Or do we just push it to the repo?

Shivkant-Chauhan commented 1 year ago

Hi, @ashish-patwal and @Shivkant-Chauhan, we finished writing the acceptance test for exploration creator 4, and we are just wondering where do we submit our code for review? Or do we just push it to the repo?

you need to open a PR for the same! also please try to check that your tests are running fine in your local machine

Shivkant-Chauhan commented 1 year ago

Can someone help me with configuring Jasmine for e2e testing... I have been trying since yesterday, unable to make any progress

Hi, would it be fine for you to ping me on the Google Chat? --shivkantchauhan2002@gmail.com

SACHARYAS commented 1 year ago

Resolved, missed something while rereading

SACHARYAS commented 1 year ago

Hi @ashish-patwal and @Shivkant-Chauhan, To use the type function do we find the CSS selector of the input field by inspecting elements on the website or is there another way?

suraj-mandal commented 1 year ago

Hi, @Shivkant-Chauhan pinged you

agallop commented 1 year ago

Hello @Shivkant-Chauhan. I am a first-time contributor and would like to tackle the Translation admins user journeys (3.1, 3.2). Would you mind assigning me?

Thank you

SACHARYAS commented 1 year ago

Hi @ashish-patwal and @Shivkant-Chauhan, following up on my question from 2 weeks ago. I'm almost done but need this clarified before I can pull request

Shivkant-Chauhan commented 1 year ago

Hi @ashish-patwal and @Shivkant-Chauhan, To use the type function do we find the CSS selector of the input field by inspecting elements on the website or is there another way?

Hi @ashish-patwal and @Shivkant-Chauhan, To use the type function do we find the CSS selector of the input field by inspecting elements on the website or is there another way?

Yes, you need to have the CSS selector for that field. Please go through the already written tests of Blog Admin and Blog Editor, you will get a fair idea of how to proceed

Shivkant-Chauhan commented 1 year ago

Hello @Shivkant-Chauhan. I am a first-time contributor and would like to tackle the Translation admins user journeys (3.1, 3.2). Would you mind assigning me?

Thank you

done..

Shivkant-Chauhan commented 1 year ago

Hello everyone, I would like to inform that the PR for the acceptance tests workflow and the script for executing the acceptance tests has been submitted to the develop branch. From now on, it is possible to run acceptance tests for any suite by using the command python -m script.run_acceptance_tests --suite="{{suiteName}}". It is important to ensure that your branches are updated with the latest changes from the develop branch.

(tagging all for notifying) @maxliu2001 @SACHARYAS @noramark @agallop @suraj-mandal @michbyiri @SahilB1 @jjxiong23 @aashanp01 @katehrkim @caramelmelmel @marcella-stefan

suraj-mandal commented 1 year ago

Thanks a lot.. it will be easier now

caramelmelmel commented 1 year ago

thanks! will note this! pulling branch now!