-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Implement part of #17712 : Acceptance tests for Exploration Creator Section(CUJ 9). #19780
Conversation
…lorationEditor
Hi @rahat2134 please assign the required reviewer(s) for this PR. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @rahat2134. The "top-level" of the tests needs some work so I've focused on that in this review, PTAL.
@@ -2,7 +2,7 @@ | |||
<div class="d-flex flex-column-reverse"> | |||
<span class="oppia-cke-offline-warning" *ngIf="!connectedToInternet">* Tools with dark background can not be used when offline.</span> | |||
</div> | |||
<div contenteditable="true" class="oppia-rte-resizer oppia-rte e2e-test-rte" #oppiaRTE></div> | |||
<div contenteditable="true" class="oppia-rte-resizer oppia-rte e2e-test-rte" id="oppia-exploration-introd-box-input" #oppiaRTE></div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't use IDs. See existing tests which use classes. We try not to use IDs because IDs are supposed to be unique within the page and it's hard to guarantee that (especially when the page is made up of multiple components).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@seanlip I have resolved this issue. No id used. ✅
* @param {string} username - The username of the exploration creator. | ||
* @returns {e2eExplorationCreator} - The instance of the exploration creator. | ||
*/ | ||
let createExplorationCreator = async function(username) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please follow the existing pattern set by other function names in this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@seanlip its also changed to createNewExplorationCreator() as per pattern.✅
superAdmin = await userFactory.createNewSuperAdmin('Leader'); | ||
}, DEFAULT_SPEC_TIMEOUT); | ||
|
||
it('should perform exploration creation and basic actions', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is too vague. Explain more clearly what the user is doing in this test. I can't tell by reading the test description.
Also I think you might need to split this into multiple tests, each testing a particular scenario. I notice that all of these tests are from the creator's point of view only and don't have adequate verification. Think through what is needed to verify these actions from a user perspective. For example, if you want to verify that the title has changed then there should be another actor (a lesson player) who views the exploration and confirms that the title there has changed as well. Or if you want to verify that the exploration is deleted then another actor (a lesson player) should go to that URL and find a 404. Similarly for the others.
You might want to try this with just one scenario first, get that reviewed and merged, then tackle the other scenarios.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@seanlip PTAL.
1)split this into multiple tests - ✅
2)If we want to verify whether the title has changed
or any other aspect of the exploration from the user's perspective, the exploration creator needs to publish the exploration. This is because a private exploration will not be visible to a guest user. To publish the exploration, we need to fill in all the required fields such as title, goal, language, category, etc. Only after filling in all these details, we can publish the exploration and verify it. However, this approach of checking/verifying after all step is not efficient. Rather, it would be better to use the exploration creator and check the exploration at each step. For other aspects of the exploration, we can check them after publishing from user perspective.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable, feel free to structure the test so that it is reasonably efficient from a "flow" perspective.
However, I think creators might be able to view the /explore/... page for their own private explorations (not 100% sure about this though). If so, then maybe that might help simplify things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, correct they are able to view. That's what i am trying to use in tests also. Thanks.
|
||
await explorationCreator.createExploration(); | ||
await explorationCreator.goToBasicSettingsTab(); | ||
await explorationCreator.expectTitleToHaveMaxLength(36); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not something the exploration creator "expects" -- write these actions from the perspective of a user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@seanlip i think this is now resolved .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure it's resolved. If I understand Sean correctly, the creator doesn't only expect the length to be below 36, they expect the title to be equal to "Your Title here".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@seanlip its also answered, as it was mentioned in doc to check only for title to be below 36 so..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This acceptance test must be written from the perspective of an end user. An end user will not go to the exploration editor, update the title, and expect it to have a length of less than 36. They might expect a specific warning to be shown. Or they might expect that, if they try to enter a title that has > 36 chars, it shows an error (or if they enter characters past a certain length, it shows the truncated title only). And so on.
Your test should be written so that it reads similar to end user actions, as described above. If the spreadsheet does not match this then the spreadsheet needs modification and you might want to request clarification for those cases.
Also the link in your last comment doesn't load for me FYI.
'explorationAdm', 'voiceover admin'); | ||
|
||
await explorationCreator.createExploration(); | ||
await explorationCreator.goToBasicSettingsTab(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only have a settings tab, not a "basic settings" tab.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved by new commits ✅
await explorationCreator.makeExplorationPublic(); | ||
await explorationCreator.expectExplorationAccessibility(); | ||
await explorationCreator.voiceArtistAdded(); | ||
await explorationCreator.expectVoiceArtistToBeAdded(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which voice artist? I would expect this to be parameterized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I will parameterize all the needed functions. I had hard-coded the person as 'guestUsr3' in the utils.js file. If it needs to be parameterized, I will rectify it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, in general your utility functions should be general things that do the desired action (and the internals of the function should not make assumptions about data on the server, which users there are, etc. -- those things would need to be parameterized).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@seanlip its also resolved as now i have parameterised all the required functions->
etc.
await explorationCreator.expectExplorationAccessibility(); | ||
await explorationCreator.voiceArtistAdded(); | ||
await explorationCreator.expectVoiceArtistToBeAdded(); | ||
await explorationCreator.selectVoiceArtist(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't know what this means from PM perspective.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@seanlip it need to be deleted, so its deleted. Main steps include -> add voice artists.
...puppeteer-acceptance-tests/spec/exploration-editor-tests/exploration-creator-manager.spec.js
Outdated
Show resolved
Hide resolved
await explorationCreator.expectVoiceArtistToBeAdded(); | ||
await explorationCreator.selectVoiceArtist(); | ||
await explorationCreator.chooseToRecieveNotification(); | ||
await explorationCreator.expectFeedbackNotificationChoice(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally, any expect() methods should have a parameter with the expected outcome (unless the expected outcome is obvious from the name of the method, like expectExplorationToBeDeleted).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will keep this in mind.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@seanlip its also resolved in above comments.
|
||
it('should perform exploration management actions', | ||
async function() { | ||
await explorationCreator.createExploration(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may need to separate these.
Think very carefully about how you would verify the outcomes of these actions, too. Don't just simply have the actions be executed. You will probably want multiple separate tests, with each test testing a flow in detail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@seanlip It is now resolved. I have separated it and made it more readable.
Hmm, most of the changes required the naming convention. Will keep this in mind and try to solve this and utils.js file also in next commit. |
…lorationEditor
Hi @rahat2134. 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! |
1 similar comment
Hi @rahat2134. 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! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @rahat2134. One small thing, otherwise basically LGTM!
@@ -188,6 +188,9 @@ export class BaseUser { | |||
*/ | |||
async clearAllTextFrom(selector: string): Promise<void> { | |||
await this.waitForElementToBeClickable(selector); | |||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For inline comments, use this format:
// Clicking three times ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
(I think you can get this merged once @StephenYu2018 approves, too. Well done!) |
Assigning @U8NWXD for code owner reviews. Thanks! |
@StephenYu2018 PTAL. Addressed all the changes. If you feel satisfied please add this to the merge queue. Thanks |
Hi @rahat2134. 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! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! :)
Unassigning @StephenYu2018 since they have already approved the PR. |
Hi @rahat2134, 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 Please add this to the merge queue if no further review is required. Thanks. |
Overview
fixes part of Acceptance Testing - covering all the Creator's and Contributor's CUJs. #17712 .
Points:
( 9- User can do the Basic setting: Title, Goal, Add a category, Language, Name of the first card, Tags, Advance features, Roles, Voice artist, Permissions ……..
10- User can Publish the latest changes, User can draft the latest changes)
Essential Checklist
Proof that changes are correct
PR Pointers