Skip to content

Commit

Permalink
created project for obs/audio with custom language
Browse files Browse the repository at this point in the history
  • Loading branch information
Bobbykumar706584 committed Oct 18, 2023
1 parent d3f2520 commit 8b3cac2
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
12 changes: 11 additions & 1 deletion e2e-tests/base.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import {
goToProjectPage, exportProjects, archivedProjects,
unarchivedProjects, goToEditProject, changeAppLanguage,
projectTargetLanguage, userProfileValidaiton,
exportAudioProject, updateDescriptionAbbriviation, changeLicense, customAddEditLanguage
exportAudioProject, updateDescriptionAbbriviation, changeLicense,
customAddEditLanguage, customProjectTargetLanguage
} from './common';

const fs = require('fs');
Expand Down Expand Up @@ -410,6 +411,15 @@ test("Custom text translation with custom language project", async ({ customText
await expect(projectName).toBe(customTextTargetLanguage);
})

//Obs and Audio custom target language RTL project
test("Custom obs project with custom language project", async ({ customObsTargetLanguage }) => {
await customProjectTargetLanguage(window, expect, customObsTargetLanguage, "OBS", "custom obs language test description", "cotp", "add-language", "obs target language", 'cotl', "RTL", "create-language")
})

test("Custom audio project with custom language project", async ({ customAudioTargetLanguage }) => {
await customProjectTargetLanguage(window, expect, customAudioTargetLanguage, "Audio", "custom audio language test description", "catp", "add-language", "audio target language", 'catl', "RTL", "create-language")
})

/* updating user profile */
test("Update user Profile", async () => {
await userProfileValidaiton(window, expect)
Expand Down
23 changes: 23 additions & 0 deletions e2e-tests/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,29 @@ export const customAddEditLanguage = async (window, expect, openModal, targetLan
await window.locator(`//*[@aria-label="${createLanguage}"]`).click()
}

///obs and audio custom target language project
export const customProjectTargetLanguage = async (window, expect, projectname, flavorType, description, abb, openModal, targetLanguageName, targetLanguageCode, targetDirection, createLanguage) => {
await expect(window.locator('//a[@aria-label="new"]')).toBeVisible()
await window.locator('//a[@aria-label="new"]').click()
await expect(window.locator('//button[@aria-label="open-popover"]')).toBeVisible()
await window.locator('//button[@aria-label="open-popover"]').click()
await expect(window.locator(`//a[@data-id="${flavorType}"]`)).toBeVisible()
await window.locator(`//a[@data-id="${flavorType}"]`).click()
// checking for create project validation
await createProjectValidation(window, expect)
await expect(window.locator('//input[@id="project_name"]')).toBeVisible()
await window.locator('//input[@id="project_name"]').fill(projectname)
await expect(window.locator('//textarea[@id="project_description"]')).toBeVisible()
await window.locator('//textarea[@id="project_description"]').fill(description)
await expect(window.locator('//input[@id="version_abbreviated"]')).toBeVisible()
await window.locator('//input[@id="version_abbreviated"]').fill(abb)
//adding new custom text translation language
await customAddEditLanguage(window, expect, openModal, targetLanguageName, targetLanguageCode, targetDirection, createLanguage, flavorType)
await window.locator('//button[@aria-label="create"]').click()
const projectName = await window.innerText(`//div[@id="${projectname}"]`)
await expect(projectName).toBe(projectname);
}


// Performs user profile validation checks.
export const userProfileValidaiton = async(window, expect) => {
Expand Down
4 changes: 4 additions & 0 deletions e2e-tests/myFixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ type myFixture = {
textUnderscore: string,
obsUnderscore: string,
customTextTargetLanguage: string,
customObsTargetLanguage: string,
customAudioTargetLanguage: string,
}
const myFixtureTest = myTest.extend<myFixture>({
userName: "Playwright user",
Expand All @@ -27,6 +29,8 @@ const myFixtureTest = myTest.extend<myFixture>({
flavorText: "textTranslation",
flavorObs: "textStories",
customTextTargetLanguage: "Custom text transaltion",
customObsTargetLanguage: "Custom obs target project",
customAudioTargetLanguage: "Custom audio target project",
})

export const test = myFixtureTest;
Expand Down

0 comments on commit 8b3cac2

Please sign in to comment.