From cb5224d551b178b0285fad904ec24bd3e80c2702 Mon Sep 17 00:00:00 2001 From: Bobbykumar706584 Date: Tue, 17 Oct 2023 19:28:59 +0530 Subject: [PATCH] edit/update obs/audio description and abbriviation --- e2e-tests/base.test.ts | 26 ++++++++++++++------------ e2e-tests/common.js | 15 +++++++++++++++ 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/e2e-tests/base.test.ts b/e2e-tests/base.test.ts index b4bf05cb7..3505c6830 100644 --- a/e2e-tests/base.test.ts +++ b/e2e-tests/base.test.ts @@ -10,7 +10,7 @@ import { searchProject, checkProjectName, checkNotification, goToProjectPage, exportProjects, archivedProjects, unarchivedProjects, goToEditProject, changeAppLanguage, - projectTargetLanguage, userProfileValidaiton, exportAudioProject + projectTargetLanguage, userProfileValidaiton, exportAudioProject, updateDescriptionAbbriviation } from './common'; const fs = require('fs'); @@ -303,17 +303,7 @@ test("Restore the audio project from the archived page", async ({ audioProject } /* Update/Edit the text translation project */ test("Update/Edit text translation project of description and abbreviation", async ({ textProject }) => { await goToEditProject(window, expect, textProject) - const description = await window.textContent('//textarea[@id="project_description"]') - await expect(description).toBe('test description') - await window.locator('//textarea[@id="project_description"]').fill('edit test version') - const editDescription = await window.textContent('//textarea[@id="project_description"]') - await expect(editDescription).toBe('edit test version') - await window.locator('input[name="version_abbreviated"]').fill('tvs') - await expect(window.locator('//*[@aria-label="save-edit-project"]')).toBeVisible() - await window.locator('//*[@aria-label="save-edit-project"]').click() - await window.waitForTimeout(3000) - const title = await window.textContent('[aria-label=projects]'); - expect(await title).toBe('Projects') + await updateDescriptionAbbriviation(window, expect, "edit text translation project", "ettp") }) test("Update/Edit text translation project scope mark and luke", async ({ textProject }) => { @@ -375,6 +365,18 @@ test("Update/Edit text translation project license", async ({ textProject }) => expect(await title).toBe('Projects') }) +/* Update/Edit the obs project */ +test("Update/Edit obs project of description and abbreviation", async ({ obsProject }) => { + await goToEditProject(window, expect, obsProject) + await updateDescriptionAbbriviation(window, expect, "edit obs project", "eop") +}) + +/* Update/Edit the audio project */ +test("Update/Edit audio project of description and abbreviation", async ({ audioProject }) => { + await goToEditProject(window, expect, audioProject) + await updateDescriptionAbbriviation(window, expect, "edit audio project", "eap") +}) + /* Changing text translation project target language */ test("Changing text translation project language from English to Persian", async ({ textProject }) => { await projectTargetLanguage(window, expect, textProject, "persian", "Persian (Farsi)") diff --git a/e2e-tests/common.js b/e2e-tests/common.js index 1d429bee7..440d39b77 100644 --- a/e2e-tests/common.js +++ b/e2e-tests/common.js @@ -284,6 +284,21 @@ export const projectTargetLanguage = async (window, expect, projectName, searchL expect(title).toBe('Projects'); } +// update/edit project description and abbriviation +export const updateDescriptionAbbriviation = async (window, expect, descriptionText, abbreviation) => { + const description = await window.textContent('//textarea[@id="project_description"]') + await expect(description).toBe('test description') + await window.locator('//textarea[@id="project_description"]').fill(descriptionText) + const editDescription = await window.textContent('//textarea[@id="project_description"]') + await expect(editDescription).toBe(descriptionText) + await window.locator('input[name="version_abbreviated"]').fill(abbreviation) + await expect(window.locator('//*[@aria-label="save-edit-project"]')).toBeVisible() + await window.locator('//*[@aria-label="save-edit-project"]').click() + await window.waitForTimeout(3000) + const title = await window.textContent('[aria-label=projects]'); + expect(await title).toBe('Projects') +} + // Performs user profile validation checks. export const userProfileValidaiton = async(window, expect) => { expect(await window.locator('//*[@id="user-profile-image"]')).toBeVisible()