Skip to content
Open
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
2 changes: 0 additions & 2 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ rules:
- src/*/internal.ts
- src/bin/*.ts
- src/config.ts
- src/createLocator.ts
- src/getModulesGraph.ts
- src/index.ts
missingExports: true
unusedExports: true
Expand Down
47 changes: 47 additions & 0 deletions autotests/tests/externalLibraries.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import {test} from 'autotests';
import {expect} from 'e2ed';
import {
type Attributes,
createSimpleLocator,
createTestLocator,
getCssSelectorFromAttributesChain,
} from 'e2ed/createLocator';
import {
getModulesGraph,
type Options,
resolveImports,
resolveReexports,
} from 'e2ed/getModulesGraph';
import {type Feature, parseGherkin, ParseGherkinError} from 'e2ed/parseGherkin';

test('External libraries are reexported correctly', {meta: {testId: '35'}}, async () => {
await expect(typeof createSimpleLocator, '`createSimpleLocator` is a function').eql('function');

await expect(typeof createTestLocator, '`createTestLocator` is a function').eql('function');

await expect(
typeof getCssSelectorFromAttributesChain,
'`getCssSelectorFromAttributesChain` is a function',
).eql('function');

await expect(typeof getModulesGraph, '`getModulesGraph` is a function').eql('function');

await expect(typeof resolveImports, '`resolveImports` is a function').eql('function');

await expect(typeof resolveReexports, '`resolveReexports` is a function').eql('function');

await expect(typeof parseGherkin, '`parseGherkin` is a function').eql('function');

await expect(typeof ParseGherkinError, '`ParseGherkinError` is a class').eql('function');

const locatorAttributes: Attributes = {};
const modulesGraphOptions: Partial<Options> = {};
const gherkinFeatures: readonly Feature[] = [];

await expect(
typeof locatorAttributes === 'object' &&
typeof modulesGraphOptions === 'object' &&
gherkinFeatures.length === 0,
'Types from external libraries are imported correctly',
).ok();
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable max-classes-per-file */

import {test} from 'autotests';
import {type CreateLocator, createRootLocator, type Locator, type Node} from 'e2ed/createLocator';
import {createPageObjectsFromMultiLocator} from 'e2ed/utils';

Expand All @@ -19,6 +20,8 @@ type BarMappedLocator = CreateLocator<Locator<{qux: Void}>, Selector>;

true satisfies IsEqual<typeof fooLocator, CreateLocator<FooLocator, Selector>>;

test('Skipped test', {meta: {testId: '26'}}, async () => {});

class Foo {
readonly bar: string;

Expand Down
3 changes: 3 additions & 0 deletions autotests/tests/internalTypeTests/expect.skip.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
/* eslint-disable @typescript-eslint/no-unsafe-call */

import {test} from 'autotests';
import {htmlElementSelector} from 'autotests/selectors';
import {expect} from 'e2ed';

test('Skipped test', {meta: {testId: '27'}}, async () => {});

const someNumber = 3;

// ok
Expand Down
3 changes: 3 additions & 0 deletions autotests/tests/internalTypeTests/mockApiRoute.skip.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {test} from 'autotests';
import {CreateDevice, CreateProduct} from 'autotests/routes/apiRoutes';
import {Main} from 'autotests/routes/pageRoutes';
import {mockApiRoute, unmockApiRoute} from 'e2ed/actions';
Expand Down Expand Up @@ -29,6 +30,8 @@ const apiMockFunction = (
return {responseBody};
};

test('Skipped test', {meta: {testId: '28'}}, async () => {});

// @ts-expect-error: mockApiRoute require API route as first argument
void mockApiRoute(Main, apiMockFunction);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {test} from 'autotests';
import {Main} from 'autotests/routes/pageRoutes';
import {Base, Score} from 'autotests/routes/webSocketRoutes';
import {mockWebSocketRoute, unmockWebSocketRoute} from 'e2ed/actions';
Expand All @@ -18,6 +19,8 @@ const webSocketMockFunction = (
return {score: size > 2 ? size : 2};
};

test('Skipped test', {meta: {testId: '29'}}, async () => {});

// @ts-expect-error: mockWebSocketRoute require WebSocket route as first argument
void mockWebSocketRoute(Main, anyMockFunction);

Expand Down
3 changes: 3 additions & 0 deletions autotests/tests/internalTypeTests/pages.skip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
* @file Tests of TypeScript types for pages.
*/

import {test} from 'autotests';
import {Main, Search, Services} from 'autotests/pageObjects/pages';
import {navigateToPage} from 'e2ed/actions';

test('Skipped test', {meta: {testId: '30'}}, async () => {});

/**
* PageParams = Readonly<{mobileDevice?: MobileDeviceModel, query?: string}>
*/
Expand Down
3 changes: 3 additions & 0 deletions autotests/tests/internalTypeTests/request.skip.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {test} from 'autotests';
import {CreateDevice, UserSignUp} from 'autotests/routes/apiRoutes';
import {Main} from 'autotests/routes/pageRoutes';
import {getRandomId} from 'e2ed/generators';
Expand All @@ -9,6 +10,8 @@ declare const apiUserParams: ApiUserParams;
declare const model: MobileDeviceModel;
declare const apiDeviceParams: ApiDeviceParams;

test('Skipped test', {meta: {testId: '31'}}, async () => {});

// @ts-expect-error: request require API route as first argument
void request(Main, {requestBody: apiUserParams});

Expand Down
3 changes: 3 additions & 0 deletions autotests/tests/internalTypeTests/routes.skip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
* @file Tests of TypeScript types for routes.
*/

import {test} from 'autotests';
import {CreateDevice, UserSignUp} from 'autotests/routes/apiRoutes';
import {Search} from 'autotests/routes/pageRoutes';

test('Skipped test', {meta: {testId: '32'}}, async () => {});

/**
* RouteParams = Readonly<{model: MobileDevice}>
*/
Expand Down
3 changes: 3 additions & 0 deletions autotests/tests/internalTypeTests/selectors.skip.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import {test} from 'autotests';
import {createSelector, htmlElementSelector, locator} from 'autotests/selectors';

import type {Selector} from 'e2ed/types';

test('Skipped test', {meta: {testId: '33'}}, async () => {});

// @ts-expect-error: wrong number of arguments
htmlElementSelector.findByTestId();
// ok
Expand Down
3 changes: 3 additions & 0 deletions autotests/tests/internalTypeTests/waitForEvents.skip.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {test} from 'autotests';
import {AddUser, GetUser} from 'autotests/routes/apiRoutes';
import {
waitForNewTab,
Expand All @@ -7,6 +8,8 @@ import {
waitForResponseToRoute,
} from 'e2ed/actions';

test('Skipped test', {meta: {testId: '34'}}, async () => {});

// ok
void waitForRequest(() => false);

Expand Down
4 changes: 3 additions & 1 deletion autotests/tests/notInAllTestsPack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import {test} from 'autotests';
import {E2edError} from 'e2ed/utils';

test('not in allTests pack', {meta: {testId: '13'}}, () => {
test('not in allTests pack', {meta: {testId: '13'}}, async () => {
await Promise.resolve();

throw new E2edError('Test filtered from the pack "allTests" was running');
});
Loading
Loading