Skip to content

Commit

Permalink
edit/update obs/audio description and abbriviation
Browse files Browse the repository at this point in the history
  • Loading branch information
Bobbykumar706584 committed Oct 17, 2023
1 parent 217952f commit cb5224d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 12 deletions.
26 changes: 14 additions & 12 deletions e2e-tests/base.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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 }) => {
Expand Down Expand Up @@ -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)")
Expand Down
15 changes: 15 additions & 0 deletions e2e-tests/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit cb5224d

Please sign in to comment.