From 99d86c880e1c1dbf00572e596e3d98ec96c7bca5 Mon Sep 17 00:00:00 2001 From: Bobbykumar706584 Date: Mon, 9 Oct 2023 15:38:32 +0530 Subject: [PATCH 01/13] export text translation project --- e2e-tests/base.test.ts | 8 +++++- e2e-tests/common.js | 28 ++++++++++++++++++++ renderer/src/modules/projects/ProjectList.js | 4 +++ 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/e2e-tests/base.test.ts b/e2e-tests/base.test.ts index 8afbb2507..89989f99f 100644 --- a/e2e-tests/base.test.ts +++ b/e2e-tests/base.test.ts @@ -2,7 +2,7 @@ import { test, expect } from './myFixtures'; import packageInfo from '../package.json'; -import { showLoginPage, checkLogInOrNot, userFile, userFolder, userJson, createProjectValidation, createProjects, unstarProject, starProject, userValidation, signOut, showActiveUsers, searchProject, checkProjectName, checkNotification, goToProjectPage } from './common'; +import { showLoginPage, checkLogInOrNot, userFile, userFolder, userJson, createProjectValidation, createProjects, unstarProject, starProject, userValidation, signOut, showActiveUsers, searchProject, checkProjectName, checkNotification, goToProjectPage, exportProjects } from './common'; const fs = require('fs'); const path = require('path'); @@ -235,6 +235,12 @@ test("About scribe Application and License", async () => { expect(title).toBe('Projects'); }) +/* exports project */ +test("Export text translation project in the Downloads folder", async ({ textProject }) => { + await exportProjects(window, expect, textProject) +}) + + /*signing out */ test("Sign out the Application", async () => { await signOut(window, expect) diff --git a/e2e-tests/common.js b/e2e-tests/common.js index f225f96a7..fb1d58108 100644 --- a/e2e-tests/common.js +++ b/e2e-tests/common.js @@ -180,6 +180,34 @@ export const goToProjectPage = async (window, expect) => { await window.waitForTimeout(1000) } +// export projects +export const exportProjects = async (window, expect, projectname) => { + await expect(window.locator('//*[@id="projects-list"]')).toBeVisible() + const table = window.locator('//*[@id="projects-list"]') + const body = table.locator('//*[@id="projects-list-unstar"]') + const rows = await body.locator('tr') + for (let i = 0; i < await rows.count(); i++) { + const row = await rows.nth(i); + const tds = await row.locator('td'); + if (await tds.nth(1).textContent() === projectname) { + expect(await tds.last().locator('[aria-label=unstar-expand-project]')).toBeVisible() + await tds.last().locator('[aria-label=unstar-expand-project]').click() + await window.waitForTimeout(1000) + await window.locator('.pl-5 > div > div').click() + await window.locator('//*[@aria-label="unstar-export-project"]').click() + await expect(window.locator('input[name="location"]')).toBeVisible() + await window.locator('input[name="location"]').fill('/home/bobby/Downloads') + await window.locator('//*[@aria-label="export-projects"]').click() + await window.waitForTimeout(2000) + const notifyMe = await window.locator('//*[@id="__next"]/div[2]/div').isVisible() + expect(await notifyMe === true) + expect(await rows.count()).toBe(4) + await window.locator('[aria-label=unstar-arrow-up]').click() + break + } + } +} + // sing out export const signOut = async (window, expect) => { await expect(window.locator('//*[@id="user-profile"]')).toBeVisible() diff --git a/renderer/src/modules/projects/ProjectList.js b/renderer/src/modules/projects/ProjectList.js index c4d37c513..2eb2cfc30 100644 --- a/renderer/src/modules/projects/ProjectList.js +++ b/renderer/src/modules/projects/ProjectList.js @@ -262,6 +262,7 @@ export default function ProjectList() { {({ active }) => ( From 4dc044bd63f21fe310393136e05796af8b800d48 Mon Sep 17 00:00:00 2001 From: Bobbykumar706584 Date: Mon, 9 Oct 2023 16:18:44 +0530 Subject: [PATCH 05/13] unarchive text translation project --- e2e-tests/base.test.ts | 4 ++++ e2e-tests/common.js | 29 +++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/e2e-tests/base.test.ts b/e2e-tests/base.test.ts index 496ddd6c7..3542d908a 100644 --- a/e2e-tests/base.test.ts +++ b/e2e-tests/base.test.ts @@ -253,6 +253,10 @@ test("Archive text translation project", async ({ textProject }) => { await archivedProjects(window, expect, textProject) }) +test("Restore text translation project from archived page", async ({ textProject }) => { + await unarchivedProjects(window, expect, textProject) +}) + /*signing out */ test("Sign out the Application", async () => { diff --git a/e2e-tests/common.js b/e2e-tests/common.js index 64b43b239..65895c8a4 100644 --- a/e2e-tests/common.js +++ b/e2e-tests/common.js @@ -237,6 +237,35 @@ export const archivedProjects = async (window, expect, projectname) => { await expect(projectTitle).toBe('Projects'); } +// unarchived projects +export const unarchivedProjects = async (window, expect, projectname) => { + await window.locator('//*[@aria-label="archived-projects"]').click() + await expect(window.locator('//*[@id="projects-list"]')).toBeVisible() + const table = window.locator('//*[@id="projects-list"]') + const body = table.locator('//*[@id="projects-list-unstar"]') + const rows = await body.locator('tr') + for (let i = 0; i < await rows.count(); i++) { + const row = await rows.nth(i); + const tds = await row.locator('td'); + if (await tds.nth(1).textContent() === projectname) { + expect(await tds.last().locator('[aria-label=unstar-expand-project]')).toBeVisible() + await tds.last().locator('[aria-label=unstar-expand-project]').click() + await window.locator('.pl-5 > div > div').click({ timeout: 4000 }) + await window.locator('//*[@aria-label="unstar-archive-restore-project"]').click() + await window.waitForTimeout(500) + expect(await rows.count()).toBe(0) + break + } + } + const archiveTitle = await window.locator('//*[@aria-label="projects"]').textContent() + + await expect(archiveTitle).toBe("Archived projects") + await window.locator('//*[@aria-label="active-projects"]').click() + const projectName = await window.innerText(`//div[@id="${projectname}"]`) + await expect(projectName).toBe(projectname); + const projectTitle = await window.locator('//*[@aria-label="projects"]').textContent() + await expect(projectTitle).toBe('Projects'); +} // sing out export const signOut = async (window, expect) => { From 32689a40ba14e15b604b93aa24a9ae96722c74c3 Mon Sep 17 00:00:00 2001 From: Bobbykumar706584 Date: Mon, 9 Oct 2023 16:25:12 +0530 Subject: [PATCH 06/13] archive/unarchive obs and audio project --- e2e-tests/base.test.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/e2e-tests/base.test.ts b/e2e-tests/base.test.ts index 3542d908a..c6a1be166 100644 --- a/e2e-tests/base.test.ts +++ b/e2e-tests/base.test.ts @@ -257,6 +257,22 @@ test("Restore text translation project from archived page", async ({ textProject await unarchivedProjects(window, expect, textProject) }) +test("Archive obs project", async ({ obsProject }) => { + await archivedProjects(window, expect, obsProject) +}) + +test("Restore the obs project from archived page", async ({ obsProject }) => { + await unarchivedProjects(window, expect, obsProject) +}) + +test("Archive audio project", async ({ audioProject }) => { + await archivedProjects(window, expect, audioProject) +}) + +test("Restore the audio project from the archived page", async ({ audioProject }) => { + await unarchivedProjects(window, expect, audioProject) +}) + /*signing out */ test("Sign out the Application", async () => { From bb04e637cf433d8f71e2d379831baa0d48a76a5f Mon Sep 17 00:00:00 2001 From: Bobbykumar706584 Date: Mon, 9 Oct 2023 16:34:04 +0530 Subject: [PATCH 07/13] edit text translation description and abrriation --- e2e-tests/base.test.ts | 17 ++++++++++++++++- e2e-tests/common.js | 18 ++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/e2e-tests/base.test.ts b/e2e-tests/base.test.ts index c6a1be166..41c89be0d 100644 --- a/e2e-tests/base.test.ts +++ b/e2e-tests/base.test.ts @@ -2,7 +2,7 @@ import { test, expect } from './myFixtures'; import packageInfo from '../package.json'; -import { showLoginPage, checkLogInOrNot, userFile, userFolder, userJson, createProjectValidation, createProjects, unstarProject, starProject, userValidation, signOut, showActiveUsers, searchProject, checkProjectName, checkNotification, goToProjectPage, exportProjects, archivedProjects, unarchivedProjects } from './common'; +import { showLoginPage, checkLogInOrNot, userFile, userFolder, userJson, createProjectValidation, createProjects, unstarProject, starProject, userValidation, signOut, showActiveUsers, searchProject, checkProjectName, checkNotification, goToProjectPage, exportProjects, archivedProjects, unarchivedProjects, goToEditProject } from './common'; const fs = require('fs'); const path = require('path'); @@ -273,6 +273,21 @@ test("Restore the audio project from the archived page", async ({ audioProject } await unarchivedProjects(window, expect, audioProject) }) +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('//button[@aria-label="save-edit-project"]')).toBeVisible() + await window.locator('//button[@aria-label="save-edit-project"]').click() + await window.waitForTimeout(3000) + const title = await window.textContent('[aria-label=projects]'); + expect(await title).toBe('Projects') +}) + /*signing out */ test("Sign out the Application", async () => { diff --git a/e2e-tests/common.js b/e2e-tests/common.js index 65895c8a4..5a99a369e 100644 --- a/e2e-tests/common.js +++ b/e2e-tests/common.js @@ -267,6 +267,24 @@ export const unarchivedProjects = async (window, expect, projectname) => { await expect(projectTitle).toBe('Projects'); } +export const goToEditProject = async (window, expect, projectName) => { + await expect(window.locator('//*[@id="projects-list"]')).toBeVisible() + const table = window.locator('//*[@id="projects-list"]') + const body = table.locator('//*[@id="projects-list-unstar"]') + const rows = await body.locator('tr') + for (let i = 0; i < await rows.count(); i++) { + const row = rows.nth(i); + const tds = row.locator('td'); + if (await tds.nth(1).textContent() === projectName) { + await tds.last().locator('[aria-label=unstar-expand-project]').click() + await window.locator('[aria-label=unstar-menu-project]').click() + await window.locator('//*[@aria-label="edit-project"]').click() + const text = await window.innerText('//*[@id="__next"]/div/div[2]/header/div/div[1]/div/h1') + await expect(text).toBe('EDIT PROJECT') + } + } +} + // sing out export const signOut = async (window, expect) => { await expect(window.locator('//*[@id="user-profile"]')).toBeVisible() From ee34425a477c1e09ebb8f171cf4e9cc339d328ea Mon Sep 17 00:00:00 2001 From: Bobbykumar706584 Date: Mon, 9 Oct 2023 16:47:26 +0530 Subject: [PATCH 08/13] updating text tranaltion project scope with mark and luke --- e2e-tests/base.test.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/e2e-tests/base.test.ts b/e2e-tests/base.test.ts index 41c89be0d..721377d95 100644 --- a/e2e-tests/base.test.ts +++ b/e2e-tests/base.test.ts @@ -288,6 +288,22 @@ test("Update/Edit text translation project of description and abbreviation", asy expect(await title).toBe('Projects') }) +test("Update/Edit text translation project scope mark and luke", async ({ textProject }) => { + await goToEditProject(window, expect, textProject) + await expect(window.locator('//button[@id="open-advancesettings"]')).toBeVisible() + await window.locator('//button[@id="open-advancesettings"]').click() + await expect(window.locator('//div[@aria-label="custom-book"]')).toBeVisible() + await window.locator('//div[@aria-label="custom-book"]').click() + await window.locator('//*[@aria-label="nt-Mark"]').click() + await window.locator('//*[@aria-label="nt-Luke"]').click() + await window.locator('//*[@id="save-canon"]').click() + await expect(window.locator('//button[@aria-label="save-edit-project"]')).toBeVisible() + await window.locator('//button[@aria-label="save-edit-project"]').click() + await window.waitForTimeout(2500) + const title = await window.textContent('[aria-label=projects]'); + expect(await title).toBe('Projects') +}) + /*signing out */ test("Sign out the Application", async () => { From d4822a1d541f7cfff6396bbf9a15ac169dcfd18b Mon Sep 17 00:00:00 2001 From: Bobbykumar706584 Date: Mon, 9 Oct 2023 16:54:39 +0530 Subject: [PATCH 09/13] updating text tranaltion project scope to NT --- e2e-tests/base.test.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/e2e-tests/base.test.ts b/e2e-tests/base.test.ts index 721377d95..46bf2fc50 100644 --- a/e2e-tests/base.test.ts +++ b/e2e-tests/base.test.ts @@ -304,6 +304,19 @@ test("Update/Edit text translation project scope mark and luke", async ({ textPr expect(await title).toBe('Projects') }) +test("Update/Edit text translation project scope custom book into NT", async ({ textProject }) => { + await goToEditProject(window, expect, textProject) + await expect(window.locator('//button[@id="open-advancesettings"]')).toBeVisible() + await window.locator('//button[@id="open-advancesettings"]').click() + await expect(window.locator('//div[@aria-label="new-testament"]')).toBeVisible() + await window.locator('//div[@aria-label="new-testament"]').click() + await window.locator('//button[contains(text(),"Ok")]').click() + await expect(window.locator('//button[@aria-label="save-edit-project"]')).toBeVisible() + await window.locator('//button[@aria-label="save-edit-project"]').click() + await window.waitForTimeout(3000) + const title = await window.textContent('[aria-label=projects]'); + expect(await title).toBe('Projects') +}) /*signing out */ test("Sign out the Application", async () => { From 0435adc0785f9220cfb984c10c2eac4d0e8ea3a1 Mon Sep 17 00:00:00 2001 From: Bobbykumar706584 Date: Mon, 9 Oct 2023 17:00:20 +0530 Subject: [PATCH 10/13] updating text tranaltion project scope with genesis and exodus from OT --- e2e-tests/base.test.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/e2e-tests/base.test.ts b/e2e-tests/base.test.ts index 46bf2fc50..f26923f52 100644 --- a/e2e-tests/base.test.ts +++ b/e2e-tests/base.test.ts @@ -318,6 +318,23 @@ test("Update/Edit text translation project scope custom book into NT", async ({ expect(await title).toBe('Projects') }) +test("Update/Edit text transaltion project scope custom book genesis and exodus from OT", async ({ textProject }) => { + await goToEditProject(window, expect, textProject) + await expect(window.locator('//button[@id="open-advancesettings"]')).toBeVisible() + await window.locator('//button[@id="open-advancesettings"]').click() + await expect(window.locator('//div[@aria-label="custom-book"]')).toBeVisible() + await window.locator('//div[@aria-label="custom-book"]').click() + await window.locator('//*[@aria-label="ot-Genesis"]').click() + await window.locator('//*[@aria-label="ot-Exodus"]').click() + await window.locator('//*[@id="save-canon"]').click() + await expect(window.locator('//button[@aria-label="save-edit-project"]')).toBeVisible() + await window.locator('//button[@aria-label="save-edit-project"]').click() + await window.waitForTimeout(3000) + const title = await window.textContent('[aria-label=projects]'); + expect(await title).toBe('Projects') +}) + + /*signing out */ test("Sign out the Application", async () => { await signOut(window, expect) From 2144d649402e6bcc2954edfcae84694e93f0477d Mon Sep 17 00:00:00 2001 From: Bobbykumar706584 Date: Mon, 9 Oct 2023 17:17:56 +0530 Subject: [PATCH 11/13] updating text tranaltion license --- e2e-tests/base.test.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/e2e-tests/base.test.ts b/e2e-tests/base.test.ts index f26923f52..ac27c5483 100644 --- a/e2e-tests/base.test.ts +++ b/e2e-tests/base.test.ts @@ -334,6 +334,19 @@ test("Update/Edit text transaltion project scope custom book genesis and exodus expect(await title).toBe('Projects') }) +test("Update/Edit text translation project license", async ({ textProject }) => { + await goToEditProject(window, expect, textProject) + await expect(window.locator('//button[@id="open-advancesettings"]')).toBeVisible() + await window.locator('//button[@id="open-advancesettings"]').click() + await window.getByRole('button', { name: 'CC BY-SA' }).click() + await window.getByRole('option', { name: 'CC BY', exact: true }).click() + await expect(window.locator('//button[@aria-label="save-edit-project"]')).toBeVisible() + await window.locator('//button[@aria-label="save-edit-project"]').click() + await window.waitForTimeout(3000) + const title = await window.textContent('[aria-label=projects]'); + expect(await title).toBe('Projects') +}) + /*signing out */ test("Sign out the Application", async () => { From 0aceab87b598d29476bd59d17ffb2d37d139588e Mon Sep 17 00:00:00 2001 From: Bobbykumar706584 Date: Tue, 10 Oct 2023 07:40:47 +0530 Subject: [PATCH 12/13] changing app language --- e2e-tests/base.test.ts | 22 +++++++++++++++++++++- e2e-tests/common.js | 11 +++++++++++ renderer/src/modules/projects/Profile.js | 1 + 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/e2e-tests/base.test.ts b/e2e-tests/base.test.ts index ac27c5483..31e585886 100644 --- a/e2e-tests/base.test.ts +++ b/e2e-tests/base.test.ts @@ -2,7 +2,7 @@ import { test, expect } from './myFixtures'; import packageInfo from '../package.json'; -import { showLoginPage, checkLogInOrNot, userFile, userFolder, userJson, createProjectValidation, createProjects, unstarProject, starProject, userValidation, signOut, showActiveUsers, searchProject, checkProjectName, checkNotification, goToProjectPage, exportProjects, archivedProjects, unarchivedProjects, goToEditProject } from './common'; +import { showLoginPage, checkLogInOrNot, userFile, userFolder, userJson, createProjectValidation, createProjects, unstarProject, starProject, userValidation, signOut, showActiveUsers, searchProject, checkProjectName, checkNotification, goToProjectPage, exportProjects, archivedProjects, unarchivedProjects, goToEditProject, changeAppLanguage } from './common'; const fs = require('fs'); const path = require('path'); @@ -347,6 +347,26 @@ test("Update/Edit text translation project license", async ({ textProject }) => expect(await title).toBe('Projects') }) +test("App language change English to hindi", async () => { + await changeAppLanguage(window, expect, "English", "Hindi") + const snackbar = await window.locator('//*[@id="__next"]/div[2]/div/div').isVisible() + expect(await snackbar === true) + const textHindi = await window.locator('//*[@aria-label="projects"]').allTextContents() + expect(await textHindi[0]).toBe("प्रोफ़ाइल") +}) + +test("App language change Hindi to English", async () => { + expect(await window.locator('//*[@aria-label="projectList"]')).toBeVisible() + await window.locator('//*[@aria-label="projectList"]').click() + await window.waitForTimeout(2000) + const title = await window.textContent('[aria-label=projects]', { timeout: 10000 }); + expect(await title).toBe('प्रोजेक्ट्स') + await changeAppLanguage(window, expect, "Hindi", "English") + const snackbar = await window.locator('//*[@id="__next"]/div[2]/div/div').isVisible() + const profile = await window.locator('//*[@aria-label="projects"]').allTextContents() + expect(await profile[0]).toBe("Profile") + expect(await snackbar === true) +}) /*signing out */ test("Sign out the Application", async () => { diff --git a/e2e-tests/common.js b/e2e-tests/common.js index 5a99a369e..5fcf35496 100644 --- a/e2e-tests/common.js +++ b/e2e-tests/common.js @@ -285,6 +285,17 @@ export const goToEditProject = async (window, expect, projectName) => { } } +export const changeAppLanguage = async (window, expect, fromLanguage, toLanguage) => { + expect(await window.locator('//*[@id="user-profile"]')).toBeVisible() + await window.locator('//*[@id="user-profile"]').click() + expect(await window.locator('//*[@aria-label="user-profile"]')).toBeVisible() + await window.locator('//*[@aria-label="user-profile"]').click() + await window.getByRole('button', { name: fromLanguage }).click() + await window.getByRole('option', { name: toLanguage }).click() + expect(await window.locator('//*[@id="save-profile"]')).toBeVisible() + await window.locator('//*[@id="save-profile"]').click() +} + // sing out export const signOut = async (window, expect) => { await expect(window.locator('//*[@id="user-profile"]')).toBeVisible() diff --git a/renderer/src/modules/projects/Profile.js b/renderer/src/modules/projects/Profile.js index 91e20f22e..6b25f923c 100644 --- a/renderer/src/modules/projects/Profile.js +++ b/renderer/src/modules/projects/Profile.js @@ -326,6 +326,7 @@ export default function UserProfile() { -

+

{snackText}