Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix part of #17712: Add curriculum admin topic management acceptance tests #19914

Merged

Conversation

Vir-8
Copy link
Contributor

@Vir-8 Vir-8 commented Mar 10, 2024

Overview

  1. This PR fixes part of Acceptance Testing - covering all the Creator's and Contributor's CUJs. #17712.
  2. This PR does the following: Adds acceptances tests for topic management, for the curriculum admin role. Tests the ability of the curriculum admin to create topics, subtopics, skills, stories, and chapters, as well as publish these creations.

Essential Checklist

  • The PR title starts with "Fix #bugnum: " or "Fix part of #bugnum: ...", followed by a short, clear summary of the changes.
  • I have followed the instructions for making a code change.
  • I have assigned the correct reviewers to this PR (or will leave a comment with the phrase "@{{reviewer_username}} PTAL" if I don't have permissions to assign reviewers directly).
  • The linter/Karma presubmit checks pass on my local machine, and my PR follows the coding style guide).
  • "Allow edits from maintainers" is checked. (See here for instructions on how to enable it.)

Proof that changes are correct

image

PR Pointers

Copy link

oppiabot bot commented Mar 10, 2024

Hi @Vir-8, can you complete the following:

  1. The body of this PR is missing the required description, please update the body with a description of what this PR does.
  2. The karma and linter checklist has not been checked, please make sure to run the frontend tests and lint tests before pushing.
    Thanks!

@oppiabot oppiabot bot assigned Vir-8 Mar 10, 2024
Copy link

oppiabot bot commented Mar 10, 2024

Hi @Vir-8 please assign the required reviewer(s) for this PR. Thanks!

Copy link

oppiabot bot commented Mar 12, 2024

Hi @Vir-8. Due to recent changes in the "develop" branch, this PR now has a merge conflict. Please follow this link if you need help resolving the conflict, so that the PR can be merged. Thanks!

@Vir-8 Vir-8 marked this pull request as ready for review March 14, 2024 18:54
@Vir-8 Vir-8 requested a review from a team as a code owner March 14, 2024 18:54
@Vir-8
Copy link
Contributor Author

Vir-8 commented Apr 18, 2024

@seanlip I've addressed all your comments and really hope it's better, I'm aware that it's failing on CI but I'm unable to reproduce the error manually and have made a debugging doc at #20184 regarding the same.

I don't see any problems in the code, PTAL meanwhile as the issue might cause extended delays.

Copy link
Member

@seanlip seanlip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have barely any concerns with the code, it looks good in general. Thanks! Please fix the minor nits and feel free to get this submitted.

Sorry to hear about the failing test though. In general it would be great to have screenshot functionality so we can take a screenshot at the failure point in GitHub Actions....or a video perhaps. Maybe one thing you can do is to try doing other actions on the page to get a sense of what's there and what's not -- basically try to log as much info as you can about the page to tell you something about its structure at the point the test fails.

'Test Subtopic 1',
'Test Topic 1'
);
await curriculumAdmin.addSkillToDiagnostingTestsOfTopic(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addSkillToDiagnosticTest(....)

(note: there is 1 diagnostic test for the math classroom, and it covers all topics)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

explorationId,
'Test Topic 1'
);
await curriculumAdmin.expectTopicToBePublishedInTopicAndSkillsDashboard(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's TopicsAndSkillsDashboard

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


export class CurriculumAdmin extends BaseUser {
/**
* Function for navigating to the topic and skills dashboard page.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can omit "Function for ...", "Function to ..." -- try to document these similar to what we do in Python, start the docstrings with a simple verb.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@seanlip seanlip removed their assignment Apr 19, 2024
@oppiabot oppiabot bot added the PR: LGTM label Apr 19, 2024
Copy link

oppiabot bot commented Apr 19, 2024

Hi @Vir-8, this PR is ready to be merged. Please address any remaining comments prior to merging, and feel free to ask someone to merge your PR once the CI checks pass and you're happy with it. Thanks!

Copy link

oppiabot bot commented Apr 20, 2024

Hi @Vir-8. Due to recent changes in the "develop" branch, this PR now has a merge conflict. Please follow this link if you need help resolving the conflict, so that the PR can be merged. Thanks!

@Vir-8
Copy link
Contributor Author

Vir-8 commented Apr 26, 2024

@seanlip The CI error has been fixed with a simple await, feel free to add this PR to the merge queue

/**
* Navigate to the creator dashboard page.
*/
async navigateToCreatorDashboardPage(): Promise<void> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't we duplicating code here? Thought this was apart of exploration editor utils already.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

/**
* Create an exploration as a curriculum admin.
*/
async createAndPublishExploration(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, I would expect this to be in the exploration editor utils, unless I'm missing some context.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're testing the curriculum admin role here though - not the exploration editor. Curriculum admins can also create and publish explorations. Ditto above, seems to be recently pushed code.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry to clarify AFAIK we are trying to separate user behaviors. Yes a curriculum admin can create and publish explorations but so can every user, we wouldn't want to duplicate this for every user role. We use composition which allows a user to have multiple classes. ATM the exploration editor class is composed by default so any function you put in there can be ran by any created user.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless this function has something specific to the curriculum admin role we should separate it into the exploration editor class.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah okay, thanks for explaining, so are you suggesting to create a separate exploration editor user in the spec to deal with exploration creation if I'm not misunderstanding? I didn't quite get what you meant by a user having multiple classes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it's fine to have one user just move these functions over to the other file and concat the types.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E.g. when we you declare curriculumAdmin: CurriculumAdmin & ExplorationEditor

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thanks!

@Vir-8 Vir-8 requested a review from jnvtnguyen April 26, 2024 17:54
Copy link
Contributor

@jnvtnguyen jnvtnguyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM.

Copy link

oppiabot bot commented Apr 26, 2024

Hi @Vir-8, this PR is ready to be merged. Please address any remaining comments prior to merging, and feel free to ask someone to merge your PR once the CI checks pass and you're happy with it. Thanks!

@seanlip seanlip added this pull request to the merge queue Apr 26, 2024
Merged via the queue into oppia:develop with commit e06f8d0 Apr 26, 2024
81 checks passed
shivanandan17 pushed a commit to shivanandan17/oppia that referenced this pull request Apr 29, 2024
…ance tests (oppia#19914)

* Create acceptance test files and implement functionality to add skills

* Add functionality to create questions

* Add functionality to create explorations

* Add thumbnail image and topic creation functionality

* Add functionality to create subtopics, stories, chapters, and publish stories

* Write the acceptance tests to create topics, stories, chapters, and publish stories

* Migrate curriculum admin tests to TypeScript

* Add comments and fix tests

* Merge remote-tracking branch 'upstream/develop' into curriculum-admin-topic-management-acceptance-test

* Fix linting issues

* Fix utility functions

* Fix tests by adding timeouts for improved stability

* Clean code

* Fix typescript issues and set the main page to the active tab

* Change comments for clarity

* Add expectation tests

* Fix linting issues

* Improve extracting exploration ID and handle exceptions

* Correct wordings and input texts

* Remove redundant wait and make question creation functionality independent of user flow

* Add comments explaining timeouts and generalize functionality for timeout event

* Fix opening skill editor before question creation

* Refactor story creation to combine functions following user flow

* Modify functionalities to use objects for user input information

* Fix handling necessary question creation

* Complete topic creation functionality including publishing topic

* Appropriately publish topics, update expectance test and replace timeouts

* Add comments for clarity

* Move helper function to spec file

* Clean code and add comments

* Fix linting issues

* Minimize flaky behaviour appropriately

* Clean code

* Modify tests to emulate mobile user behaviour

* Adjust utility to publish topics for mobile functionality

* Remove test timeouts

* Improve saving topic draft flow

* Fix new tab flake and finalize mobile utility functions

* Move exploration ID extraction function to base user utility service

* Remove objects and pass data as explicit arguments

* Fix linting issues

* Address comments and improve clarity

* Improve user utility functionality

* Reduce flakiness and improve naming

* Fix linter issues

* Fix flake and improve naming

* Fix typos and improve comments

* Fix merge issues and update suite

* Attempt to fix CI error

* Create explorations from exploration editor utils to avoid code duplication

* Remove unused variables
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants