Skip to content

Commit

Permalink
More cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
JeanneSon committed May 5, 2022
1 parent 1a02f12 commit c3bc74e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
8 changes: 1 addition & 7 deletions test/e2e/pages/projects.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ export class ProjectsPage {
if (await this.projectsPerPageDropdown.isVisible()) {
await this.projectsPerPageDropdown.selectOption('100');
}

}

async createEmptyProject(projectName: string) {
Expand Down Expand Up @@ -109,7 +108,7 @@ export class ProjectsPage {
return await this.projectsList.count();
}

// TODO@JeanneSon: in order to be able to run the tests in parallel, the countProjects function should only count the projects created in that test file
// in order to be able to run the tests in parallel, this function only counts the projects created in that test file
async countSpecificProjects(projects: string): Promise<number> {
await this.goto();
const nAllProjects = await this.projectNames.count();
Expand All @@ -135,12 +134,8 @@ export class ProjectsPage {
return '-1';
}

// findProjectRow = returns selector like "*div[data-ng-repeat='project of projects'] >> span:has-text(name)"
// Note the * which ends up returning the div instead of the span
async findProjectRow(projectName: string): Promise<Locator> {
await this.goto();
//const rowLocator = `*css=[data-ng-class="{active: $ctrl.isSelected(project)}"] >> span:has-text("${projectName}")`;
//const rowLocator = this.page.locator('css=[data-ng-class="{active: $ctrl.isSelected(project)}"]', { has: this.page.locator(`span:has-text("${projectName}")`)});
const rowLocator = this.page.locator(`css=[data-ng-class="{active: $ctrl.isSelected(project)}"]:has(span:has-text("${projectName}"))`);
if (await rowLocator.count() == 1) {
return rowLocator;
Expand Down Expand Up @@ -172,7 +167,6 @@ export class ProjectsPage {
return rowLocator.locator('text=Tech Support');
}


async clickOnProject(projectName: string) {
const projectLocatorString: string = await this.findProject(projectName);
expect(projectLocatorString).not.toEqual('-1');
Expand Down
5 changes: 3 additions & 2 deletions test/e2e/projects.spec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { expect } from '@playwright/test';
import { test } from './utils/fixtures';

import { ProjectsPage } from './pages/projects.page';
import { NoticeElement } from './components/notice.component';

import { Project } from './projects-settings.spec';

import { initTestProject, addUserToProject } from './utils/testSetup';
import { gotoProjectDirectly } from './utils/navigation';

import { NoticeElement } from './components/notice.component';


test.describe('E2E Projects List app', () => {
let projectsPageMember: ProjectsPage;
Expand Down

0 comments on commit c3bc74e

Please sign in to comment.