-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Plugin E2E: Expose variable list page as fixture (#942)
Co-authored-by: Erik Sundell <[email protected]>
- Loading branch information
Showing
12 changed files
with
109 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
packages/plugin-e2e/src/fixtures/commands/gotoVariablePage.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { TestFixture } from '@playwright/test'; | ||
import { DashboardPageArgs, PlaywrightArgs } from '../../types'; | ||
import { VariablePage } from '../../models/pages/VariablePage'; | ||
|
||
type GotoVariablePageFixture = TestFixture<(args: DashboardPageArgs) => Promise<VariablePage>, PlaywrightArgs>; | ||
|
||
export const gotoVariablePage: GotoVariablePageFixture = async ( | ||
{ request, page, selectors, grafanaVersion }, | ||
use, | ||
testInfo | ||
) => { | ||
await use(async (args) => { | ||
const variablePage = new VariablePage({ page, selectors, grafanaVersion, request, testInfo }, args); | ||
await variablePage.goto(); | ||
return variablePage; | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { TestFixture } from '@playwright/test'; | ||
import { PlaywrightArgs } from '../types'; | ||
import { VariablePage } from '../models/pages/VariablePage'; | ||
|
||
type VariablePageFixture = TestFixture<VariablePage, PlaywrightArgs>; | ||
|
||
export const variablePage: VariablePageFixture = async ( | ||
{ page, selectors, grafanaVersion, request }, | ||
use, | ||
testInfo | ||
) => { | ||
const variablePage = new VariablePage({ page, selectors, grafanaVersion, request, testInfo }); | ||
await variablePage.goto(); | ||
await use(variablePage); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters