-
-
Notifications
You must be signed in to change notification settings - Fork 278
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'sheets-viewer-final' into feature/sc-27331/new-sidebar-…
…component2
- Loading branch information
Showing
73 changed files
with
2,533 additions
and
1,505 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import {test, expect} from '@playwright/test'; | ||
import {changeLanguageOfText, goToPageWithLang, isIsraelIp} from "../utils"; | ||
import {LANGUAGES, SOURCE_LANGUAGES} from '../globals' | ||
|
||
const interfaceTextHE = 'מקורות'; | ||
const interfaceTextEN = 'Texts'; | ||
|
||
[ | ||
// Hebrew Interface and English Source | ||
{interfaceLanguage: 'Hebrew', interfaceLanguageToggle: LANGUAGES.HE, | ||
sourceLanguage: 'English', sourceLanguageToggle: SOURCE_LANGUAGES.EN, | ||
expectedSourceText: 'When God began to create', expectedBilingualText: '', expectedInterfaceText: interfaceTextHE }, | ||
|
||
// Hebrew Interface and Bilingual Source | ||
{interfaceLanguage: 'Hebrew', interfaceLanguageToggle: LANGUAGES.HE, | ||
sourceLanguage: 'Bilingual', sourceLanguageToggle: SOURCE_LANGUAGES.BI, | ||
expectedSourceText: 'רֵאשִׁ֖ית בָּרָ֣א אֱלֹהִ֑ים אֵ֥ת הַשָּׁמַ֖יִם וְאֵ֥ת הָאָֽרֶץ׃', expectedBilingualText: 'When God began to create', expectedInterfaceText: interfaceTextHE }, | ||
|
||
// Hebrew Interface and Hebrew Source | ||
{interfaceLanguage: 'Hebrew', interfaceLanguageToggle: LANGUAGES.HE, | ||
sourceLanguage: 'Hebrew', sourceLanguageToggle: SOURCE_LANGUAGES.HE, | ||
expectedSourceText: 'רֵאשִׁ֖ית בָּרָ֣א אֱלֹהִ֑ים אֵ֥ת הַשָּׁמַ֖יִם וְאֵ֥ת הָאָֽרֶץ׃', expectedBilingualText: '', expectedInterfaceText: interfaceTextHE }, | ||
|
||
// English Interface and English Source | ||
{interfaceLanguage: 'English', interfaceLanguageToggle: LANGUAGES.EN, | ||
sourceLanguage: 'English', sourceLanguageToggle: SOURCE_LANGUAGES.EN, | ||
expectedSourceText: 'When God began to create', expectedBilingualText: '', expectedInterfaceText: interfaceTextEN }, | ||
|
||
// English Interface and Bilingual Source | ||
{interfaceLanguage: 'English', sinterfaceLanguageToggle: LANGUAGES.EN, | ||
sourceLanguage: 'Bilingual', sourceLanguageToggle: SOURCE_LANGUAGES.BI, | ||
expectedSourceText: 'רֵאשִׁ֖ית בָּרָ֣א אֱלֹהִ֑ים אֵ֥ת הַשָּׁמַ֖יִם וְאֵ֥ת הָאָֽרֶץ׃', expectedBilingualText: 'When God began to create', | ||
expectedInterfaceText: interfaceTextEN }, | ||
|
||
// English Interface and Hebrew Source | ||
{interfaceLanguage: 'English', interfaceLanguageToggle: LANGUAGES.EN, | ||
sourceLanguage: 'Hebrew', sourceLanguageToggle: SOURCE_LANGUAGES.HE, | ||
expectedSourceText: 'רֵאשִׁ֖ית בָּרָ֣א אֱלֹהִ֑ים אֵ֥ת הַשָּׁמַ֖יִם וְאֵ֥ת הָאָֽרֶץ׃', expectedBilingualText: '', expectedInterfaceText: interfaceTextEN } | ||
|
||
].forEach(({interfaceLanguage, interfaceLanguageToggle, sourceLanguage, sourceLanguageToggle, expectedSourceText, expectedBilingualText, expectedInterfaceText}) => { | ||
test(`${interfaceLanguage} Interface Language with ${sourceLanguage} Source`, async ({ context }) => { | ||
|
||
// Navigating to Bereshit with selected Interface Language, Hebrew or English | ||
const page = await goToPageWithLang(context,'/Genesis.1',`${interfaceLanguageToggle}`) | ||
|
||
// Selecting Source Language | ||
await changeLanguageOfText(page, sourceLanguageToggle) | ||
|
||
// Locating the source text segment, then verifying translation | ||
await expect(page.locator('div.segmentNumber').first().locator('..').locator('p')).toContainText(`${expectedSourceText}`) | ||
|
||
// Validate Hebrew interface language is still toggled | ||
const textLink = page.locator('a.textLink').first() | ||
await expect(textLink).toHaveText(`${expectedInterfaceText}`) | ||
|
||
}) | ||
}) |
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
80 changes: 80 additions & 0 deletions
80
e2e-tests/tests/translation-version-name-appears-in-title.spec.ts
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 |
---|---|---|
@@ -0,0 +1,80 @@ | ||
import {test, expect} from '@playwright/test'; | ||
import {goToPageWithLang, changeLanguageOfText} from "../utils"; | ||
import {LANGUAGES, SOURCE_LANGUAGES} from '../globals' | ||
|
||
[ | ||
// Hebrew Interface and Hebrew Source | ||
{interfaceLanguage: 'Hebrew', interfaceLanguageToggle: LANGUAGES.HE, | ||
sourceLanguage: 'Hebrew', sourceLanguageToggle: SOURCE_LANGUAGES.HE, | ||
translations: 'תרגומים', select: 'בחירה', currentlySelected: 'נוכחי'}, | ||
|
||
// Hebrew Interface and Bilingual Source | ||
{interfaceLanguage: 'Hebrew', interfaceLanguageToggle: LANGUAGES.HE, | ||
sourceLanguage: 'Bilingual', sourceLanguageToggle: SOURCE_LANGUAGES.BI, | ||
translations: 'תרגומים', select: 'בחירה', currentlySelected: 'נוכחי'}, | ||
|
||
// Hebrew Interface and English Source | ||
{interfaceLanguage: 'Hebrew', interfaceLanguageToggle: LANGUAGES.HE, | ||
sourceLanguage: 'English', sourceLanguageToggle: SOURCE_LANGUAGES.EN, | ||
translations: 'תרגומים', select: 'בחירה', currentlySelected: 'נוכחי'}, | ||
|
||
// English Interface and English Source | ||
{interfaceLanguage: 'English', interfaceLanguageToggle: LANGUAGES.EN, | ||
sourceLanguage: 'English', sourceLanguageToggle: SOURCE_LANGUAGES.EN, | ||
translations: 'Translations', select: 'Select', currentlySelected: 'Currently Selected'}, | ||
|
||
// English Interface and English Source | ||
{interfaceLanguage: 'English', interfaceLanguageToggle: LANGUAGES.EN, | ||
sourceLanguage: 'Bilingual', sourceLanguageToggle: SOURCE_LANGUAGES.BI, | ||
translations: 'Translations', select: 'Select', currentlySelected: 'Currently Selected'}, | ||
|
||
// English Interface and Hebrew Source | ||
{interfaceLanguage: 'English', interfaceLanguageToggle: LANGUAGES.EN, | ||
sourceLanguage: 'Hebrew', sourceLanguageToggle: SOURCE_LANGUAGES.HE, | ||
translations: 'Translations', select: 'Select', currentlySelected: 'Currently Selected'} | ||
|
||
].forEach(({interfaceLanguage, interfaceLanguageToggle, sourceLanguage, sourceLanguageToggle, translations, currentlySelected, select}) => { | ||
test(`${interfaceLanguage} - translation name appears in title for ${sourceLanguage} source text`, async ({ context }) => { | ||
// Navigate to Bereshit in specified Interface Language | ||
const page = await goToPageWithLang(context,'/Genesis.1', `${interfaceLanguageToggle}`) | ||
|
||
// Change the Source Language of the text | ||
await changeLanguageOfText(page, sourceLanguageToggle) | ||
|
||
// Retain the translation name locator | ||
const translationNameInTitle = page.locator('span.readerTextVersion') | ||
|
||
// Navigate to the Translations sidebar by clicking on the text title | ||
//Clicks on בראשית א׳ / Genesis I | ||
await page.locator('h1').click() | ||
|
||
// Click on Translations | ||
await page.getByRole('link', {name: `${translations}`}).click() | ||
|
||
// Wait for Translations side-bar to load by waiting for 'Translations' header | ||
await page.waitForSelector('h3') | ||
|
||
// Check if the default translation in the title matches the selected translation | ||
// NOTE: We are skipping checking for the default translation here, due to the Hebrew text being default Masoretic | ||
if(sourceLanguage !== 'Hebrew'){ | ||
const defaultTranslation = await translationNameInTitle.textContent() | ||
await expect(page.locator('div.version-with-preview-title-line', {hasText: defaultTranslation!}).getByRole('link')).toHaveText(`${currentlySelected}`) | ||
} | ||
|
||
// TODO: 4th translation, handling Hebrew Interface translations in Hebrew. For example: 'חומש רש״י, רבי שרגא זילברשטיין' should appear in the translation title as written. | ||
const translationNames = ['The Schocken Bible, Everett Fox, 1995 ©', '«Да» project'] | ||
|
||
// Utilizing the traditional for-loop as there are async issues with foreach | ||
for(let i = 0; i < translationNames.length; i++){ | ||
|
||
// "Select" another translation. | ||
await page.locator('div.version-with-preview-title-line', {hasText: translationNames[i]}).getByText(`${select}`).click() | ||
|
||
// Validate selected translation is reflected in title | ||
await expect(translationNameInTitle).toHaveText(translationNames[i]) | ||
|
||
// Validate selected translation says 'Currently Selected' | ||
await expect(page.locator('div.version-with-preview-title-line', {hasText: translationNames[i]}).getByRole('link')).toHaveText(`${currentlySelected}`) | ||
} | ||
}) | ||
}); |
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.