Skip to content

Commit

Permalink
removed extra slase
Browse files Browse the repository at this point in the history
  • Loading branch information
Bobbykumar706584 committed Sep 27, 2023
1 parent 623d522 commit 653d8fb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
30 changes: 15 additions & 15 deletions e2e-tests/base.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,23 @@ test('Check whether the app is being logged IN', async () => {
});

test('If logged IN then logout and delete that user from the backend', async ({ userName }) => {
///user json
//user json
const json = await userJson(window, packageInfo, fs, path)
/// user file
// user file
const file = await userFile(window, packageInfo, path)
/// user folde name
// user folde name
const folder = await userFolder(window, userName, packageInfo, path)

if (await checkLogInOrNot(window, expect)) {
await window.getByRole('button', { name: "Open user menu" }).click()
const currentUser = await window.textContent('[aria-label="userName"]')
await window.getByRole('menuitem', { name: "Sign out" }).click()
/// projects page then logout and delete playwright user
// projects page then logout and delete playwright user
if (currentUser.toLowerCase() === userName.toLowerCase() && await fs.existsSync(folder)) {
await showLoginPage(fs, folder, userName, json, file, window, expect)
}
} else {
///loging page, if playwright user exist then reload app and remove
// loging page, if playwright user exist then reload app and remove
const existUser = json.some((item) => item.username.toLowerCase() === userName.toLowerCase())
if (existUser && await fs.existsSync(folder)) {
await showLoginPage(fs, folder, userName, json, file, window, expect)
Expand All @@ -66,7 +66,7 @@ test('Create a new user and login', async ({ userName }) => {
})

/*CREATE PROJECTS FOR ALL FLAVOR TYPE */
// // /* Translation Project */
/* Translation Project */
test('Click New and Fill project page details to create a new project for text translation with custom book', async ({ textProject }) => {
await expect(window.locator('//a[@aria-label="new"]')).toBeVisible()
await window.getByRole('link', { name: 'new' }).click()
Expand All @@ -92,18 +92,18 @@ test('Click New and Fill project page details to create a new project for text t
expect(title).toBe('Projects');
})

///Obs translation project
/* Obs translation project */
test('Click New and Fill project page details to create a new project for obs', async ({ obsProject }) => {
await createProjects(window, expect, obsProject, "OBS", "test description", "otp")
})

/////Audio project
/* Audio project */
test('Click Click New and Fill project page details to create a new project for audio', async ({ audioProject }) => {
await createProjects(window, expect, audioProject, "Audio", "test description", "atp")
})

/* STAR & UNSTAR PROJECT */
///text translation
// text translation
test("Star the text project", async ({ textProject }) => {
await starProject(window, expect, textProject)
})
Expand All @@ -112,7 +112,7 @@ test("Unstar the text project", async ({ textProject }) => {
await unstarProject(window, expect, textProject)
})

///obs
// obs
test("Star the obs project", async ({ obsProject }) => {
await starProject(window, expect, obsProject)
})
Expand All @@ -121,7 +121,7 @@ test("Unstar the obs project", async ({ obsProject }) => {
await unstarProject(window, expect, obsProject)
})

// ///audio
// audio
test("Star the audio project", async ({ audioProject }) => {
await starProject(window, expect, audioProject)
})
Expand All @@ -131,16 +131,16 @@ test("Unstar the audio project", async ({ audioProject }) => {
})

test("Logout and delete that playwright user from the backend", async ({ userName }) => {
///user json
// user json
const json = await userJson(window, packageInfo, fs, path)
/// user file
// user file
const file = await userFile(window, packageInfo, path)
/// user folde name
// user folde name
const folder = await userFolder(window, userName, packageInfo, path)
await window.getByRole('button', { name: "Open user menu" }).click()
const currentUser = await window.textContent('[aria-label="userName"]')
await window.getByRole('menuitem', { name: "Sign out" }).click()
/// projects page then logout and delete playwright user
// projects page then logout and delete playwright user
if (currentUser.toLowerCase() === userName.toLowerCase() && await fs.existsSync(folder)) {
await showLoginPage(fs, folder, userName, json, file, window, expect)
}
Expand Down
4 changes: 2 additions & 2 deletions e2e-tests/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@ export const createProjectValidation = async (window, expect) => {
await window.waitForTimeout(3000)
}

///function for creating a project for obs and audio
/* function for creating a project for obs and audio */
export const createProjects = async (window, expect, projectname, type, description, abb) => {
await expect(window.locator('//a[@aria-label="new"]')).toBeVisible()
await window.getByRole('link', { name: '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="${type}"]`)).toBeVisible()
await window.locator(`//a[@data-id="${type}"]`).click()
////checking for create project validation
// 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)
Expand Down

0 comments on commit 653d8fb

Please sign in to comment.