Skip to content

Commit

Permalink
about application
Browse files Browse the repository at this point in the history
  • Loading branch information
Bobbykumar706584 committed Oct 5, 2023
1 parent f4757da commit e27b9b3
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 2 deletions.
13 changes: 12 additions & 1 deletion e2e-tests/base.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, exportProject } from './common';

const fs = require('fs');
const path = require('path');
Expand Down Expand Up @@ -233,6 +233,17 @@ test('Return to the projects page from audio editor', async () => {
});


test("About scribe Application and License", async () => {
await window.locator('//*[@aria-label="about-button"]').click()
const developedby = await window.innerText('[aria-label=developed-by]');
expect(developedby).toBe('Developed by Bridge Connectivity Solutions');
await window.click('[aria-label=license-button]');
await window.locator('//*[@aria-label="about-description"]').click()
await window.click('[aria-label=close-about]');
const title = await window.textContent('[aria-label=projects]', { timeout: 10000 });
expect(title).toBe('Projects');
})

test("Sign out the Application", async () => {
await signOut(window, expect)
})
Expand Down
82 changes: 81 additions & 1 deletion e2e-tests/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,86 @@ export const goToProjectPage = async (window, expect) => {
await window.waitForTimeout(1000)
}

export const exportProject = async (window, expect, projectname) => {
expect(await window.locator('//*[@id="projects-list"]')).toBeVisible()
const table = await 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="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()
}
}

}

export const archivedProjects = async (window, expect, projectname) => {
await expect(await 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="archive-project"]').click()
expect(await rows.count()).toBe(4)
await window.locator('//*[@aria-label="archive-active-button"]').click()
const title = await window.locator('//*[@aria-label="projects"]').textContent()
expect(await title).toBe("Archived projects")
const projectName = await window.innerText(`//div[@id="${projectname}"]`)
expect(projectName).toBe(projectname);
}
}
await window.locator('//*[@aria-label="archive-active-button"]').click()
const title = await window.textContent('[aria-label=projects]', { timeout: 10000 });
expect(title).toBe('Projects');
}

export const unarchivedProjects = async (window, expect, projectname) => {
await window.locator('//*[@aria-label="archive-active-button"]').click()
await expect(await 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="archive-project"]').click()
await window.waitForTimeout(500)
expect(await rows.count()).toBe(0)
const title = await window.locator('//*[@aria-label="projects"]').textContent()
expect(await title).toBe("Archived projects")
}
}
await window.locator('//*[@aria-label="archive-active-button"]').click()
const title = await window.textContent('[aria-label=projects]', { timeout: 10000 });
expect(title).toBe('Projects');
}



export const signOut = async (window, expect) => {
expect(await window.locator('//*[@id="user-profile"]')).toBeVisible()
Expand All @@ -195,7 +275,7 @@ export const signOut = async (window, expect) => {
}

export const showActiveUsers = async (window, expect) => {
expect(await window.locator('//*[@id="view-more"]')).toBeVisible()
// expect(await window.locator('//*[@id="view-more"]')).toBeVisible()
await window.locator('//*[@id="view-more"]').click()
const active = await window.locator('//*[@id="active-tab"]').textContent()
expect(await active).toBe("Active")
Expand Down
1 change: 1 addition & 0 deletions renderer/src/layouts/editor/AboutModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export default function AboutModal(props) {
onClick={() => setTabNumber(0)}
role="button"
tabIndex="0"
aria-label="about-description"
className={`flex items-center justify-center p-2 leading-6 text-sm text-black hover:text-primary uppercase tracking-wide font-bold border-0 border-b-4 ${tabNumber === 0 ? 'border-primary' : 'border-transparent hover:border-black'}`}
>
<InformationCircleIcon
Expand Down
1 change: 1 addition & 0 deletions renderer/src/layouts/projects/Export/ExportProjectPopUp.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ export default function ExportProjectPopUp(props) {
<button
disabled={exportStart}
onClick={() => exportBible()}
aria-label="export-projects"
type="button"
className="py-2 px-7 rounded shadow bg-success text-white uppercase text-xs tracking-widest font-semibold"
>
Expand Down

0 comments on commit e27b9b3

Please sign in to comment.