-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test(e2e): added new cases #6
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { Page } from '@playwright/test'; | ||
|
||
export class BasePage { | ||
|
||
constructor(protected page: Page) {} | ||
|
||
public goto = (adress: string) => this.page.goto(adress); | ||
} | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { BasePage } from '../base/base.po'; | ||
|
||
export class DashboartFilterpanelPage extends BasePage { | ||
public readonly pageAdress = '/dashboard-filter-panel'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 2 spaces indent |
||
|
||
|
||
public gotoMainPage = async () => await this.goto(this.pageAdress); | ||
public weightedPipelineValue = () => this.page.getByText('Weighted pipeline value (€)', {exact: true}).first(); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { test, expect } from '@playwright/test'; | ||
import { DashboartFilterpanelPage } from './dashboard-filter-panel.po'; | ||
|
||
test.describe('Dashboard filter panel page', () => { | ||
test('should have working initial screen', async ({ page }) => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 2 spaces indent |
||
// given | ||
const dashboartFilterpanelPage = new DashboartFilterpanelPage(page); | ||
|
||
// when | ||
await dashboartFilterpanelPage.gotoMainPage(); | ||
await dashboartFilterpanelPage.weightedPipelineValue().waitFor({ state: 'visible' }); | ||
|
||
// then | ||
await expect(page).toHaveScreenshot('init-page.png', { maxDiffPixelRatio: 0.1, fullPage: true}); | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { BasePage } from '../base/base.po'; | ||
|
||
export class DragNDropChartLibraryPage extends BasePage { | ||
public readonly pageAdress = '/drag-n-drop-chart-library'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 2 spaces indent |
||
|
||
|
||
public gotoMainPage = async () => await this.goto(this.pageAdress); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { test, expect } from '@playwright/test'; | ||
import { DragNDropChartLibraryPage } from './drag-n-drop-chart-library.po'; | ||
|
||
test.describe('Drag and drop page', () => { | ||
test('should have working initial screen', async ({ page }) => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 2 spaces indent |
||
// given | ||
const dragNDropChartLibraryPage = new DragNDropChartLibraryPage(page); | ||
|
||
// when | ||
await dragNDropChartLibraryPage.gotoMainPage(); | ||
|
||
// then | ||
await expect(page).toHaveScreenshot('init-page.png', { maxDiffPixelRatio: 0.1, fullPage: true}); | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,10 @@ | ||
import { Page } from '@playwright/test'; | ||
import { BasePage } from '../base/base.po'; | ||
|
||
export class ReportBuilderPage { | ||
/** | ||
* @todo: Extract to config file | ||
*/ | ||
public readonly URL = 'https://d2ojv9ksm0gp58.cloudfront.net/report-builder/'; | ||
export class ReportBuilderPage extends BasePage { | ||
public readonly pageAdress = '/report-builder/'; | ||
|
||
constructor( | ||
private page: Page, | ||
) {} | ||
|
||
public gotoMainPage = () => this.page.goto(this.URL); | ||
public gotoMainPage = async () => await this.goto(this.pageAdress); | ||
|
||
public tableContainer = () => this.page.locator('.regular-table-container'); | ||
public chartOneBar = () => this.page.locator('.bars-container .bar').first(); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { BasePage } from '../base/base.po'; | ||
|
||
export class WearablesDashboardPage extends BasePage { | ||
public readonly pageAdress = '/wearables-dashboard'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 2 spaces indent |
||
|
||
|
||
public gotoMainPage = async () => await this.goto(this.pageAdress); | ||
public NumberOfStepsChart = () => this.page.getByText('Number of steps by minute', {exact: true}); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add new line in EOF |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { test, expect } from '@playwright/test'; | ||
import { WearablesDashboardPage } from '../wearables-dashboard/wearables-dashboard.po'; | ||
|
||
test.describe('Wearables dashboard', () => { | ||
test('should have working initial screen', async ({ page }) => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 2 spaces indent |
||
// given | ||
const wearablesDashboardPage = new WearablesDashboardPage(page); | ||
|
||
// when | ||
await wearablesDashboardPage.gotoMainPage(); | ||
await wearablesDashboardPage.NumberOfStepsChart().waitFor({ state: 'visible' }); | ||
|
||
// then | ||
await expect(page).toHaveScreenshot('init-page.png', { maxDiffPixelRatio: 0.1, fullPage: true}); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check each file and add. new line to the end of file