forked from oppia/oppia
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GSoC'24] M1.1: Fix a part of oppia#20374 : Acceptance test coverage …
…for Curriculum admin's CUJs. (oppia#20379) * updates * updates * updates * updates * updates * updates * updates * updates * updates * updates * updates
- Loading branch information
1 parent
afcc0c3
commit efd8370
Showing
13 changed files
with
641 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,43 +19,42 @@ | |
import {UserFactory} from '../../utilities/common/user-factory'; | ||
import testConstants from '../../utilities/common/test-constants'; | ||
import {CurriculumAdmin} from '../../utilities/user/curriculum-admin'; | ||
import {ExplorationEditor} from '../../utilities/user/exploration-editor'; | ||
import {LoggedInUser} from '../../utilities/user/logged-in-user'; | ||
import {ConsoleReporter} from '../../utilities/common/console-reporter'; | ||
|
||
const DEFAULT_SPEC_TIMEOUT_MSECS = testConstants.DEFAULT_SPEC_TIMEOUT_MSECS; | ||
const ROLES = testConstants.Roles; | ||
|
||
// To ignore console errors that occur when checking if the | ||
// topic link returns a 404 status upon unpublishing. | ||
ConsoleReporter.setConsoleErrorsToIgnore([ | ||
/HttpErrorResponse:.*404 Not Found/, | ||
/Occurred at http:\/\/localhost:8181\/learn\/staging\/test-topic-one \.?/, | ||
/http:\/\/localhost:8181\/learn\/staging\/test-topic-one \.?/, | ||
/Failed to load resource: the server responded with a status of 404 \(Not Found\)/, | ||
]); | ||
|
||
describe('Curriculum Admin', function () { | ||
let curriculumAdmin: CurriculumAdmin & ExplorationEditor; | ||
let explorationId: string | null; | ||
let curriculumAdmin: CurriculumAdmin; | ||
let loggedInUser: LoggedInUser; | ||
|
||
beforeAll(async function () { | ||
curriculumAdmin = await UserFactory.createNewUser( | ||
'curriculumAdm', | ||
'[email protected]', | ||
[ROLES.CURRICULUM_ADMIN] | ||
); | ||
|
||
loggedInUser = await UserFactory.createNewUser( | ||
'loggedInUser', | ||
'[email protected]' | ||
); | ||
}, DEFAULT_SPEC_TIMEOUT_MSECS); | ||
|
||
it( | ||
'should create and publish topics, subtopics, skills, stories and chapters.', | ||
'should manage topics and skills: create, assign, publish, unpublish, and delete.', | ||
async function () { | ||
await curriculumAdmin.navigateToCreatorDashboardPage(); | ||
await curriculumAdmin.navigateToExplorationEditorPage(); | ||
await curriculumAdmin.dismissWelcomeModal(); | ||
await curriculumAdmin.createExplorationWithMinimumContent( | ||
'Test Exploration', | ||
'End Exploration' | ||
); | ||
await curriculumAdmin.saveExplorationDraft(); | ||
explorationId = await curriculumAdmin.publishExplorationWithContent( | ||
'Test Exploration Title 1', | ||
'Test Exploration Goal', | ||
'Algebra' | ||
); | ||
if (!explorationId) { | ||
throw new Error('Error publishing exploration successfully.'); | ||
} | ||
|
||
await curriculumAdmin.navigateToTopicAndSkillsDashboardPage(); | ||
await curriculumAdmin.createTopic('Test Topic 1', 'test-topic-one'); | ||
await curriculumAdmin.createSubtopicForTopic( | ||
'Test Subtopic 1', | ||
|
@@ -76,19 +75,28 @@ describe('Curriculum Admin', function () { | |
); | ||
|
||
await curriculumAdmin.publishDraftTopic('Test Topic 1'); | ||
await curriculumAdmin.createAndPublishStoryWithChapter( | ||
'Test Story 1', | ||
'test-story-one', | ||
explorationId, | ||
'Test Topic 1' | ||
); | ||
await curriculumAdmin.expectTopicToBePublishedInTopicsAndSkillsDashboard( | ||
'Test Topic 1', | ||
1, | ||
1, | ||
1 | ||
); | ||
|
||
await curriculumAdmin.unpublishTopic('Test Topic 1'); | ||
await loggedInUser.expectTopicLinkReturns404('test-topic-one'); | ||
|
||
await curriculumAdmin.deleteTopic('Test Topic 1'); | ||
await curriculumAdmin.expectTopicNotInTopicsAndSkillDashboard( | ||
'Test Topic 1' | ||
); | ||
|
||
// User must remove all questions from the skill before deleting it. | ||
await curriculumAdmin.removeAllQuestionsFromTheSkill('Test Skill 1'); | ||
await curriculumAdmin.deleteSkill('Test Skill 1'); | ||
await curriculumAdmin.expectSkillNotInTopicsAndSkillsDashboard( | ||
'Test Skill 1' | ||
); | ||
}, | ||
|
||
DEFAULT_SPEC_TIMEOUT_MSECS | ||
); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.