Skip to content
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

Plugin E2E: Change package imports and exports #838

Merged
merged 4 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
295 changes: 0 additions & 295 deletions packages/plugin-e2e/src/api.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/plugin-e2e/src/auth/auth.setup.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { test as setup } from '../api';
import { test as setup } from '../';

setup('authenticate', async ({ login, createUser, user }) => {
if (user) {
Expand Down
15 changes: 5 additions & 10 deletions packages/plugin-e2e/src/fixtures/annotationEditPage.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import { TestFixture } from '@playwright/test';
import { PluginFixture, PluginOptions } from '../api';
import { AnnotationEditPage, AnnotationPage } from '../models';
import { PlaywrightCombinedArgs } from './types';
import { PlaywrightArgs } from '../types';
import { AnnotationPage } from '../models/pages/AnnotationPage';
import { AnnotationEditPage } from '../models/pages/AnnotationEditPage';

type AnnotationEditPageFixture = TestFixture<
AnnotationEditPage,
PluginFixture & PluginOptions & PlaywrightCombinedArgs
>;
type AnnotationEditPageFixture = TestFixture<AnnotationEditPage, PlaywrightArgs>;

const annotationEditPage: AnnotationEditPageFixture = async (
export const annotationEditPage: AnnotationEditPageFixture = async (
{ page, selectors, grafanaVersion, request },
use,
testInfo
Expand All @@ -18,5 +15,3 @@ const annotationEditPage: AnnotationEditPageFixture = async (
const annotationEditPage = await annotationPage.clickAddNew();
await use(annotationEditPage);
};

export default annotationEditPage;
10 changes: 3 additions & 7 deletions packages/plugin-e2e/src/fixtures/commands/createDataSource.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { v4 as uuidv4 } from 'uuid';
import { APIRequestContext, expect, TestFixture } from '@playwright/test';
import { PluginFixture, PluginOptions } from '../../api';
import { CreateDataSourceArgs, DataSourceSettings } from '../../types';
import { PlaywrightCombinedArgs } from '../types';
import { CreateDataSourceArgs, DataSourceSettings, PlaywrightArgs } from '../../types';

type CreateDataSourceViaAPIFixture = TestFixture<
(args: CreateDataSourceArgs) => Promise<DataSourceSettings>,
PluginFixture & PluginOptions & PlaywrightCombinedArgs
PlaywrightArgs
>;

export const createDataSourceViaAPI = async (
Expand Down Expand Up @@ -40,10 +38,8 @@ export const createDataSourceViaAPI = async (
return existingDataSource.json();
};

const createDataSource: CreateDataSourceViaAPIFixture = async ({ request }, use) => {
export const createDataSource: CreateDataSourceViaAPIFixture = async ({ request }, use) => {
await use(async (args) => {
return createDataSourceViaAPI(request, args);
});
};

export default createDataSource;
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import { TestFixture } from '@playwright/test';
import { PluginFixture, PluginOptions } from '../../api';
import { CreateDataSourcePageArgs } from '../../types';
import { PlaywrightCombinedArgs } from '../types';
import { DataSourceConfigPage } from '../../models';
import { CreateDataSourcePageArgs, PlaywrightArgs } from '../../types';
import { createDataSourceViaAPI } from './createDataSource';
import { DataSourceConfigPage } from '../../models/pages/DataSourceConfigPage';

type CreateDataSourceConfigPageFixture = TestFixture<
(args: CreateDataSourcePageArgs) => Promise<DataSourceConfigPage>,
PluginFixture & PluginOptions & PlaywrightCombinedArgs
PlaywrightArgs
>;

const createDataSourceConfigPage: CreateDataSourceConfigPageFixture = async (
export const createDataSourceConfigPage: CreateDataSourceConfigPageFixture = async (
{ request, page, selectors, grafanaVersion },
use,
testInfo
Expand All @@ -26,5 +24,3 @@ const createDataSourceConfigPage: CreateDataSourceConfigPageFixture = async (
});
deleteDataSource && (await datasourceConfigPage?.deleteDataSource());
};

export default createDataSourceConfigPage;
Loading
Loading