Skip to content

Commit 708188a

Browse files
committed
refactor: sort imports across multiple files with lint:fix
1 parent 376f391 commit 708188a

11 files changed

Lines changed: 18 additions & 18 deletions

playwright.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
* See https://playwright.dev/docs/test-configuration for more details.
55
*/
66

7-
import { ACTION_TIMEOUT, EXPECT_TIMEOUT, NAVIGATION_TIMEOUT, TEST_TIMEOUT } from '@constants/timeouts';
8-
import { defineConfig, devices } from '@playwright/test';
97
import os from 'os';
8+
import { defineConfig, devices } from '@playwright/test';
109
import dotenv from 'dotenv';
10+
import { ACTION_TIMEOUT, EXPECT_TIMEOUT, NAVIGATION_TIMEOUT, TEST_TIMEOUT } from '@constants/timeouts';
1111
dotenv.config({ path: '.env' });
1212

1313
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing

src/vasu-playwright-lib/utils/action-utils.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
* These actions include navigation, interaction with page elements, handling of dialogs, and more.
44
*/
55
import test, { Locator } from '@playwright/test';
6-
import { getPage } from './page-utils';
6+
import { getDefaultLoadState } from '../constants/loadstate';
7+
import { SMALL_TIMEOUT, STANDARD_TIMEOUT } from '../constants/timeouts';
78
import {
89
ActionOptions,
910
CheckOptions,
@@ -21,10 +22,9 @@ import {
2122
UploadValues,
2223
VisibilityOption,
2324
} from '../types/optional-parameter-types';
24-
import { SMALL_TIMEOUT, STANDARD_TIMEOUT } from '../constants/timeouts';
25-
import { getLocator, getVisibleLocator } from './locator-utils';
26-
import { getDefaultLoadState } from '../constants/loadstate';
2725
import { waitForElementToBeStable } from './element-utils';
26+
import { getLocator, getVisibleLocator } from './locator-utils';
27+
import { getPage } from './page-utils';
2828

2929
/**
3030
* 1. Actions: This section contains functions for interacting with elements on a web page.

src/vasu-playwright-lib/utils/api-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { getPage } from './page-utils';
21
import { APIRequestContext, APIResponse } from '@playwright/test';
2+
import { getPage } from './page-utils';
33

44
/**
55
* Retrieves the APIRequestContext from the current page equivalent to request from playwright fixture.

src/vasu-playwright-lib/utils/assert-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88
import { Expect, Locator, TestInfo, expect } from '@playwright/test';
99
import { ExpectOptions, ExpectTextOptions, SoftOption, TimeoutOption } from '../types/optional-parameter-types';
10+
import { getAlertText } from './action-utils';
1011
import { getLocator } from './locator-utils';
1112
import { getAllPages, getPage } from './page-utils';
12-
import { getAlertText } from './action-utils';
1313

1414
/**
1515
* Returns an Expect object configured with the given soft option.

src/vasu-playwright-lib/utils/element-utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
*/
77

88
import test, { Locator } from '@playwright/test';
9+
import { SMALL_TIMEOUT } from '../constants/timeouts';
10+
import { logger } from '../setup';
911
import { LocatorWaitOptions, TimeoutOption } from '../types/optional-parameter-types';
1012
import { getAllLocators, getLocator } from './locator-utils';
11-
import { SMALL_TIMEOUT } from '../constants/timeouts';
1213
import { wait } from './page-utils';
13-
import { logger } from '../setup';
1414

1515
/**
1616
* 1. Retreiving Data: Use these functions to retrieve text, values, and counts from web elements.

src/vasu-playwright-lib/utils/locator-utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55

66
import { Frame, FrameLocator, Locator } from '@playwright/test';
7-
import { getPage } from './page-utils';
7+
import { defaultVisibleOnlyOption } from '../constants';
88
import {
99
FrameOptions,
1010
GetByPlaceholderOptions,
@@ -14,8 +14,8 @@ import {
1414
LocatorOptions,
1515
LocatorWaitOptions,
1616
} from '../types/optional-parameter-types';
17-
import { defaultVisibleOnlyOption } from '../constants';
1817
import { waitForFirstElementToBeAttached } from './element-utils';
18+
import { getPage } from './page-utils';
1919

2020
/**
2121
* 1. Locators: This section contains functions and definitions related to locators.

src/vasu-playwright-lib/utils/page-utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
* It also includes functions for switching between pages, closing pages, and reverting to the default page.
66
*/
77

8-
import { SMALL_TIMEOUT } from '../constants/timeouts';
98
import { BrowserContext, Page, Response, expect } from '@playwright/test';
9+
import { getDefaultLoadState } from '../constants';
10+
import { SMALL_TIMEOUT } from '../constants/timeouts';
1011
import {
1112
GotoOptions,
1213
NavigationOptions,
1314
SwitchPageOptions,
1415
WaitForLoadStateOptions,
1516
} from '../types/optional-parameter-types';
16-
import { getDefaultLoadState } from '../constants';
1717

1818
let page: Page;
1919

tests/pages/sauce-demo/sauce-demo-checkout-page.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
import { checkoutInfo } from '@testdata/sauce-demo-test-data';
12
import { clickAndNavigate, fill } from '@utils/action-utils';
23
import { expectElementToContainText } from '@utils/assert-utils';
34
import { getLocator, getLocatorByRole } from '@utils/locator-utils';
4-
import { checkoutInfo } from '@testdata/sauce-demo-test-data';
55

66
const cartLink = () => getLocator('#shopping_cart_container').locator('a');
77
const checkoutButton = () => getLocatorByRole('button', { name: 'Checkout' });

tests/pages/sauce-demo/sauce-demo-login-page.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { click, clickAndNavigate, fill } from '@utils/action-utils';
21
import { failureLoginCredentials, sauceDemoCredentials } from '@testdata/sauce-demo-test-data';
2+
import { click, clickAndNavigate, fill } from '@utils/action-utils';
33
import { expectElementToBeAttached, expectElementToBeVisible } from '@utils/assert-utils';
44
import { getLocator, getLocatorByPlaceholder, getLocatorByRole } from '@utils/locator-utils';
55
import { gotoURL } from '@utils/page-utils';

tests/specs/sauce-demo-failure.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { test } from '@pagesetup';
21
import * as LoginPage from '@pages/sauce-demo/sauce-demo-login-page';
32
import * as ProductsPage from '@pages/sauce-demo/sauce-demo-products-page';
3+
import { test } from '@pagesetup';
44

55
/*
66
To run the tests sequentially and skip the remaining tests in the spec file upon encountering the first failure,

0 commit comments

Comments
 (0)