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 #9409: Fix e2e flakes #9437

Merged
merged 1 commit into from Jun 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -229,8 +229,9 @@ describe('Exploration translation and voiceover tab', function() {
await creatorDashboardPage.editExploration('Test Exploration');
await explorationEditorMainTab.exitTutorial();
await explorationEditorPage.navigateToTranslationTab();
await explorationEditorTranslationTab.expectToBeInVoiceoverMode();
await explorationEditorTranslationTab.exitTutorial();
await explorationEditorTranslationTab.changeLanguage('Hindi');
await explorationEditorTranslationTab.expectToBeInVoiceoverMode();

await explorationEditorTranslationTab.switchToTranslationMode();
await explorationEditorTranslationTab.expectToBeInTranslationMode();
Expand Down
12 changes: 12 additions & 0 deletions core/tests/protractor_utils/ExplorationEditorTranslationTab.js
Expand Up @@ -414,21 +414,29 @@ var ExplorationEditorTranslationTab = function() {
};

this.expectToBeInTranslationMode = async function() {
await waitFor.visibilityOf(languageSelectorLabelElement,
'Language selector label element taking too long to appear');
expect(await languageSelectorLabelElement.getText()).toBe(
'Translations for language:');
expect(await progressBarLabelElement.getText()).toBe(
'Exploration translation progress:');
await waitFor.visibilityOf(translationModeButton,
'Translation mode button taking to long to appear');
expect(await translationModeButton.getAttribute('class')).toMatch(
'oppia-active-mode');
expect(await voiceoverModeButton.getAttribute('class')).not.toMatch(
'oppia-active-mode');
};

this.expectToBeInVoiceoverMode = async function() {
await waitFor.visibilityOf(languageSelectorLabelElement,
'Language selector label element taking too long to appear');
expect(await languageSelectorLabelElement.getText()).toBe(
'Voiceovers for language:');
expect(await progressBarLabelElement.getText()).toBe(
'Exploration voiceover progress:');
await waitFor.visibilityOf(translationModeButton,
'Translation mode button taking to long to appear');
expect(await translationModeButton.getAttribute('class')).not.toMatch(
'oppia-active-mode');
expect(await voiceoverModeButton.getAttribute('class')).toMatch(
Expand Down Expand Up @@ -477,6 +485,8 @@ var ExplorationEditorTranslationTab = function() {
};

this.expectNumericalStatusAccessibilityToMatch = async function(content) {
await waitFor.visibilityOf(numericalStatus,
'Numerical status element taking too long to appear');
expect(await numericalStatus.getAttribute('aria-label')).toMatch(content);
};

Expand Down Expand Up @@ -521,6 +531,8 @@ var ExplorationEditorTranslationTab = function() {
};

this.expectSelectedLanguageToBe = async function(language) {
await waitFor.visibilityOf(selectedLanguageElement,
'Selected language element taking too long to appear');
expect(await selectedLanguageElement.getText()).toMatch(language);
};

Expand Down