transit-core-taf 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +286 -0
- package/package.json +4 -7
- package/dist/transit-core-taf/base/basepageactions.d.ts +0 -178
- package/dist/transit-core-taf/base/basepageactions.js +0 -288
- package/dist/transit-core-taf/base/basepagevalidations.d.ts +0 -296
- package/dist/transit-core-taf/base/basepagevalidations.js +0 -459
- package/dist/transit-core-taf/base/basepagewaits.d.ts +0 -54
- package/dist/transit-core-taf/base/basepagewaits.js +0 -169
- package/dist/transit-core-taf/base/commonpageactions.d.ts +0 -40
- package/dist/transit-core-taf/base/commonpageactions.js +0 -118
- package/dist/transit-core-taf/base/commonpagevalidations.d.ts +0 -10
- package/dist/transit-core-taf/base/commonpagevalidations.js +0 -21
- package/dist/transit-core-taf/base/commonpagewaits.d.ts +0 -28
- package/dist/transit-core-taf/base/commonpagewaits.js +0 -57
- package/dist/transit-core-taf/base/logger.d.ts +0 -10
- package/dist/transit-core-taf/base/logger.js +0 -42
- package/dist/transit-core-taf/baseapi/apiutils.d.ts +0 -9
- package/dist/transit-core-taf/baseapi/apiutils.js +0 -23
- package/dist/transit-core-taf/baseapi/baseapihelpers.d.ts +0 -10
- package/dist/transit-core-taf/baseapi/baseapihelpers.js +0 -45
- package/dist/transit-core-taf/constants/apiconstants.d.ts +0 -29
- package/dist/transit-core-taf/constants/apiconstants.js +0 -38
- package/dist/transit-core-taf/constants/test-tags.d.ts +0 -14
- package/dist/transit-core-taf/constants/test-tags.js +0 -17
- package/dist/transit-core-taf/fixtures.d.ts +0 -23
- package/dist/transit-core-taf/fixtures.js +0 -81
- package/dist/transit-core-taf/global-setup.d.ts +0 -2
- package/dist/transit-core-taf/global-setup.js +0 -103
- package/dist/transit-core-taf/index.d.ts +0 -23
- package/dist/transit-core-taf/index.js +0 -39
- package/dist/transit-core-taf/steps/basepageactions.steps.d.ts +0 -1
- package/dist/transit-core-taf/steps/basepageactions.steps.js +0 -92
- package/dist/transit-core-taf/steps/basepagevalidations.steps.d.ts +0 -1
- package/dist/transit-core-taf/steps/basepagevalidations.steps.js +0 -59
- package/dist/transit-core-taf/steps/basepagewaits.steps.d.ts +0 -1
- package/dist/transit-core-taf/steps/basepagewaits.steps.js +0 -29
- package/dist/transit-core-taf/steps/commonpageactions.steps.d.ts +0 -1
- package/dist/transit-core-taf/steps/commonpageactions.steps.js +0 -18
- package/dist/transit-core-taf/steps/commonpagevalidations.steps.d.ts +0 -1
- package/dist/transit-core-taf/steps/commonpagevalidations.steps.js +0 -16
- package/dist/transit-core-taf/steps/commonpagewaits.steps.d.ts +0 -1
- package/dist/transit-core-taf/steps/commonpagewaits.steps.js +0 -24
- package/dist/transit-core-taf/steps/hooks.d.ts +0 -1
- package/dist/transit-core-taf/steps/hooks.js +0 -10
- package/dist/transit-core-taf/steps/world.d.ts +0 -12
- package/dist/transit-core-taf/steps/world.js +0 -37
- package/dist/transit-core-taf/utils/Utils.d.ts +0 -114
- package/dist/transit-core-taf/utils/Utils.js +0 -219
- package/dist/transit-core-taf/utils/envutils.d.ts +0 -2
- package/dist/transit-core-taf/utils/envutils.js +0 -55
- package/dist/transit-core-taf/utils/excelUtils.d.ts +0 -1
- package/dist/transit-core-taf/utils/excelUtils.js +0 -51
- package/dist/transit-core-taf/utils/networkutils.d.ts +0 -24
- package/dist/transit-core-taf/utils/networkutils.js +0 -53
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { Locator, Page } from '@playwright/test';
|
|
2
|
-
import { Logger } from './logger';
|
|
3
|
-
export declare class CommonPageActions {
|
|
4
|
-
private page;
|
|
5
|
-
private waits;
|
|
6
|
-
constructor(page: Page, logger: Logger);
|
|
7
|
-
/**
|
|
8
|
-
* Click on an element if it's not expanded.
|
|
9
|
-
* @param locator The locator of the element.
|
|
10
|
-
*/
|
|
11
|
-
clickIfNotExpanded(locator: Locator): Promise<void>;
|
|
12
|
-
/**
|
|
13
|
-
* Clicks an element without waiting for a full page load or network idle.
|
|
14
|
-
* This is ideal for clicking on-page elements like tabs that don't trigger navigation.
|
|
15
|
-
* @param element The locator of the element to click.
|
|
16
|
-
* @param timeout Optional timeout in ms.
|
|
17
|
-
*/
|
|
18
|
-
clickElementOnly(element: Locator, timeout?: number): Promise<void>;
|
|
19
|
-
/**
|
|
20
|
-
* Removes the cookie consent popup from the DOM.
|
|
21
|
-
*/
|
|
22
|
-
acceptCookiePopup(): Promise<void>;
|
|
23
|
-
/**
|
|
24
|
-
* Accepts the Transcend consent banner if it is visible.
|
|
25
|
-
*/
|
|
26
|
-
acceptTranscendConsent(): Promise<void>;
|
|
27
|
-
/**
|
|
28
|
-
* Performs a robust, manual drag-and-drop by simulating mouse actions.
|
|
29
|
-
* This is useful for complex UIs where `dragTo` might fail.
|
|
30
|
-
* @param source The locator of the element to drag.
|
|
31
|
-
* @param target The locator of the drop target.
|
|
32
|
-
*/
|
|
33
|
-
dragAndDrop(source: Locator, target: Locator): Promise<void>;
|
|
34
|
-
/**
|
|
35
|
-
* Waits for a given element to be hidden on the page.
|
|
36
|
-
* @param element - The Playwright Locator of the element to wait for.
|
|
37
|
-
* @param timeout - Optional timeout in milliseconds (default: 10000).
|
|
38
|
-
*/
|
|
39
|
-
waitForElementToBeHidden(element: Locator, timeout?: number): Promise<void>;
|
|
40
|
-
}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CommonPageActions = void 0;
|
|
4
|
-
const basepagewaits_1 = require("./basepagewaits");
|
|
5
|
-
class CommonPageActions {
|
|
6
|
-
page;
|
|
7
|
-
waits;
|
|
8
|
-
constructor(page, logger) {
|
|
9
|
-
this.page = page;
|
|
10
|
-
this.waits = new basepagewaits_1.BasePageWaits(page, logger);
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Click on an element if it's not expanded.
|
|
14
|
-
* @param locator The locator of the element.
|
|
15
|
-
*/
|
|
16
|
-
async clickIfNotExpanded(locator) {
|
|
17
|
-
const isExpanded = await locator.getAttribute('aria-expanded');
|
|
18
|
-
if (isExpanded !== 'true') {
|
|
19
|
-
await locator.click();
|
|
20
|
-
await this.waits.waitForDomContentLoad();
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Clicks an element without waiting for a full page load or network idle.
|
|
25
|
-
* This is ideal for clicking on-page elements like tabs that don't trigger navigation.
|
|
26
|
-
* @param element The locator of the element to click.
|
|
27
|
-
* @param timeout Optional timeout in ms.
|
|
28
|
-
*/
|
|
29
|
-
async clickElementOnly(element, timeout = 30000) {
|
|
30
|
-
console.log(`[Action] Clicking element without page load wait: ${element}`);
|
|
31
|
-
await element.waitFor({ state: 'visible', timeout });
|
|
32
|
-
await element.click({ timeout });
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Removes the cookie consent popup from the DOM.
|
|
36
|
-
*/
|
|
37
|
-
async acceptCookiePopup() {
|
|
38
|
-
console.log('Attempting to accept cookie popup by clicking "OKAY"');
|
|
39
|
-
try {
|
|
40
|
-
/**First, try to click the "OKAY" button */
|
|
41
|
-
const okayButton = this.page.locator('button:has-text("OKAY")');
|
|
42
|
-
await okayButton.waitFor({ state: 'visible', timeout: 5000 });
|
|
43
|
-
await okayButton.click();
|
|
44
|
-
console.log('Successfully clicked "OKAY" on the cookie popup.');
|
|
45
|
-
}
|
|
46
|
-
catch (error) {
|
|
47
|
-
/** If clicking "OKAY" fails, fall back to the original DOM removal method */
|
|
48
|
-
console.log('Could not find or click "OKAY" button, falling back to DOM removal.');
|
|
49
|
-
await this.page.evaluate(() => {
|
|
50
|
-
const el = document.getElementById('transcend-consent-manager');
|
|
51
|
-
if (el) {
|
|
52
|
-
el.remove();
|
|
53
|
-
console.log('Removed transcend-consent-manager element as a fallback.');
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
console.log('transcend-consent-manager element not found for removal.');
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Accepts the Transcend consent banner if it is visible.
|
|
63
|
-
*/
|
|
64
|
-
async acceptTranscendConsent() {
|
|
65
|
-
const consentManager = this.page
|
|
66
|
-
.locator('#transcend-consent-manager')
|
|
67
|
-
.first();
|
|
68
|
-
if (await consentManager.isVisible()) {
|
|
69
|
-
await this.page.locator('button:has-text("Accept All")').click();
|
|
70
|
-
}
|
|
71
|
-
console.log('Accepting cookie popup');
|
|
72
|
-
await this.page.evaluate(() => {
|
|
73
|
-
const el = document.getElementById('transcend-consent-manager');
|
|
74
|
-
if (el) {
|
|
75
|
-
el.remove();
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Performs a robust, manual drag-and-drop by simulating mouse actions.
|
|
81
|
-
* This is useful for complex UIs where `dragTo` might fail.
|
|
82
|
-
* @param source The locator of the element to drag.
|
|
83
|
-
* @param target The locator of the drop target.
|
|
84
|
-
*/
|
|
85
|
-
async dragAndDrop(source, target) {
|
|
86
|
-
console.log(`Performing manual drag-and-drop from ${source} to ${target}`);
|
|
87
|
-
const sourceBounds = await source.boundingBox();
|
|
88
|
-
const targetBounds = await target.boundingBox();
|
|
89
|
-
if (sourceBounds && targetBounds) {
|
|
90
|
-
console.log(`Source bounds: ${JSON.stringify(sourceBounds)}`);
|
|
91
|
-
console.log(`Target bounds: ${JSON.stringify(targetBounds)}`);
|
|
92
|
-
await this.page.mouse.move(sourceBounds.x + sourceBounds.width / 2, sourceBounds.y + sourceBounds.height / 2);
|
|
93
|
-
await this.page.mouse.down();
|
|
94
|
-
await target.hover({ force: true });
|
|
95
|
-
await this.page.mouse.move(targetBounds.x + targetBounds.width / 2, targetBounds.y + targetBounds.height / 2, { steps: 5 });
|
|
96
|
-
await this.page.mouse.up();
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
throw new Error('Could not get bounding boxes for one or both drag-and-drop elements.');
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Waits for a given element to be hidden on the page.
|
|
104
|
-
* @param element - The Playwright Locator of the element to wait for.
|
|
105
|
-
* @param timeout - Optional timeout in milliseconds (default: 10000).
|
|
106
|
-
*/
|
|
107
|
-
async waitForElementToBeHidden(element, timeout = 10000) {
|
|
108
|
-
try {
|
|
109
|
-
console.log(`🔍 Waiting for element to be hidden: ${element.toString()} (timeout: ${timeout}ms)`);
|
|
110
|
-
await element.waitFor({ state: 'hidden', timeout });
|
|
111
|
-
}
|
|
112
|
-
catch (error) {
|
|
113
|
-
console.error(`❌ Element did not become hidden: ${element.toString()} within ${timeout}ms`);
|
|
114
|
-
throw error;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
exports.CommonPageActions = CommonPageActions;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Page } from '@playwright/test';
|
|
2
|
-
export declare class CommonPageValidations {
|
|
3
|
-
protected page: Page;
|
|
4
|
-
constructor(page: Page);
|
|
5
|
-
/**
|
|
6
|
-
* Validates that the page is in fullscreen mode.
|
|
7
|
-
* @param isFullScreen A boolean indicating whether the page should be in fullscreen mode.
|
|
8
|
-
*/
|
|
9
|
-
validateFullScreen(isFullScreen: boolean): Promise<void>;
|
|
10
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CommonPageValidations = void 0;
|
|
4
|
-
const test_1 = require("@playwright/test");
|
|
5
|
-
class CommonPageValidations {
|
|
6
|
-
page;
|
|
7
|
-
constructor(page) {
|
|
8
|
-
this.page = page;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Validates that the page is in fullscreen mode.
|
|
12
|
-
* @param isFullScreen A boolean indicating whether the page should be in fullscreen mode.
|
|
13
|
-
*/
|
|
14
|
-
async validateFullScreen(isFullScreen) {
|
|
15
|
-
const fullscreenState = await this.page.evaluate(() => {
|
|
16
|
-
return !!document.fullscreenElement;
|
|
17
|
-
});
|
|
18
|
-
(0, test_1.expect)(fullscreenState).toBe(isFullScreen);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
exports.CommonPageValidations = CommonPageValidations;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Locator, Page } from '@playwright/test';
|
|
2
|
-
export declare class CommonPageWaits {
|
|
3
|
-
protected page: Page;
|
|
4
|
-
constructor(page: Page);
|
|
5
|
-
/**
|
|
6
|
-
* Waits for an element's attribute to match a specific value or pattern.
|
|
7
|
-
* @param locator The Playwright Locator of the element.
|
|
8
|
-
* @param attribute The name of the attribute to check.
|
|
9
|
-
* @param value The expected value of the attribute (string or RegExp).
|
|
10
|
-
* @param timeout Optional timeout in milliseconds.
|
|
11
|
-
*/
|
|
12
|
-
waitForAttributeToBePresent(locator: Locator, attribute: string, value: string | RegExp, invert?: boolean, timeout?: number): Promise<void>;
|
|
13
|
-
/**
|
|
14
|
-
* Waits for the page URL to match a specific value or pattern.
|
|
15
|
-
* - If 'url' is a string, it waits for an exact URL match.
|
|
16
|
-
* - If 'url' is a RegExp, it waits for the URL to match the pattern.
|
|
17
|
-
* (e.g., to check if URL contains 'login', use /login/).
|
|
18
|
-
* @param url The expected URL (string for exact match, or RegExp for pattern match).
|
|
19
|
-
* @param timeout Optional timeout in milliseconds.
|
|
20
|
-
*/
|
|
21
|
-
waitForURL(url: string | RegExp, timeout?: number): Promise<void>;
|
|
22
|
-
/**
|
|
23
|
-
* Waits for an element to be hidden.
|
|
24
|
-
* @param locator The Playwright Locator of the element.
|
|
25
|
-
* @param timeout Optional timeout in milliseconds.
|
|
26
|
-
*/
|
|
27
|
-
waitForElementToBeHidden(locator: Locator, timeout?: number): Promise<void>;
|
|
28
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CommonPageWaits = void 0;
|
|
4
|
-
const test_1 = require("@playwright/test");
|
|
5
|
-
class CommonPageWaits {
|
|
6
|
-
page;
|
|
7
|
-
constructor(page) {
|
|
8
|
-
this.page = page;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Waits for an element's attribute to match a specific value or pattern.
|
|
12
|
-
* @param locator The Playwright Locator of the element.
|
|
13
|
-
* @param attribute The name of the attribute to check.
|
|
14
|
-
* @param value The expected value of the attribute (string or RegExp).
|
|
15
|
-
* @param timeout Optional timeout in milliseconds.
|
|
16
|
-
*/
|
|
17
|
-
async waitForAttributeToBePresent(locator, attribute, value, invert = false, timeout = 10000) {
|
|
18
|
-
await test_1.expect
|
|
19
|
-
.poll(async () => {
|
|
20
|
-
const attributeValue = await locator.getAttribute(attribute);
|
|
21
|
-
if (invert) {
|
|
22
|
-
return value instanceof RegExp
|
|
23
|
-
? !value.test(attributeValue || '')
|
|
24
|
-
: attributeValue !== value;
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
return value instanceof RegExp
|
|
28
|
-
? value.test(attributeValue || '')
|
|
29
|
-
: attributeValue === value;
|
|
30
|
-
}
|
|
31
|
-
}, {
|
|
32
|
-
message: `Timed out waiting for attribute "${attribute}" to ${invert ? 'not be' : 'be'} "${value}" on ${locator.toString()}`,
|
|
33
|
-
timeout: timeout,
|
|
34
|
-
})
|
|
35
|
-
.toBe(true);
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Waits for the page URL to match a specific value or pattern.
|
|
39
|
-
* - If 'url' is a string, it waits for an exact URL match.
|
|
40
|
-
* - If 'url' is a RegExp, it waits for the URL to match the pattern.
|
|
41
|
-
* (e.g., to check if URL contains 'login', use /login/).
|
|
42
|
-
* @param url The expected URL (string for exact match, or RegExp for pattern match).
|
|
43
|
-
* @param timeout Optional timeout in milliseconds.
|
|
44
|
-
*/
|
|
45
|
-
async waitForURL(url, timeout = 30000) {
|
|
46
|
-
await (0, test_1.expect)(this.page).toHaveURL(url, { timeout });
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Waits for an element to be hidden.
|
|
50
|
-
* @param locator The Playwright Locator of the element.
|
|
51
|
-
* @param timeout Optional timeout in milliseconds.
|
|
52
|
-
*/
|
|
53
|
-
async waitForElementToBeHidden(locator, timeout = 10000) {
|
|
54
|
-
await (0, test_1.expect)(locator).toBeHidden({ timeout });
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
exports.CommonPageWaits = CommonPageWaits;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare class Logger {
|
|
2
|
-
testDescription: string;
|
|
3
|
-
constructor(testDescription: string);
|
|
4
|
-
private log;
|
|
5
|
-
info(message: string): void;
|
|
6
|
-
debug(message: string): void;
|
|
7
|
-
warn(message: string): void;
|
|
8
|
-
error(message: string): void;
|
|
9
|
-
errorAndThrow(message: string): never;
|
|
10
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Logger = void 0;
|
|
4
|
-
class Logger {
|
|
5
|
-
testDescription;
|
|
6
|
-
constructor(testDescription) {
|
|
7
|
-
this.testDescription = testDescription;
|
|
8
|
-
}
|
|
9
|
-
log(level, message) {
|
|
10
|
-
const logMessage = `[${this.testDescription}] ${level.toUpperCase()}: ${message}`;
|
|
11
|
-
switch (level) {
|
|
12
|
-
case 'info':
|
|
13
|
-
console.info(logMessage);
|
|
14
|
-
break;
|
|
15
|
-
case 'warn':
|
|
16
|
-
console.warn(logMessage);
|
|
17
|
-
break;
|
|
18
|
-
case 'error':
|
|
19
|
-
console.error(logMessage);
|
|
20
|
-
break;
|
|
21
|
-
default:
|
|
22
|
-
console.log(logMessage);
|
|
23
|
-
break;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
info(message) {
|
|
27
|
-
this.log('info', message);
|
|
28
|
-
}
|
|
29
|
-
debug(message) {
|
|
30
|
-
this.log('debug', message);
|
|
31
|
-
}
|
|
32
|
-
warn(message) {
|
|
33
|
-
this.log('warn', message);
|
|
34
|
-
}
|
|
35
|
-
error(message) {
|
|
36
|
-
this.log('error', message);
|
|
37
|
-
}
|
|
38
|
-
errorAndThrow(message) {
|
|
39
|
-
throw new Error(`[${this.testDescription}] ${message}`);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
exports.Logger = Logger;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Handles the response from the API.
|
|
3
|
-
* @param {Response} response - The response object from the fetch call.
|
|
4
|
-
* @returns {Promise<{status: number, responseBody: any}>} A promise that resolves to an object containing the status and response body.
|
|
5
|
-
*/
|
|
6
|
-
export declare function handleResponse(response: Response): Promise<{
|
|
7
|
-
status: number;
|
|
8
|
-
responseBody: any;
|
|
9
|
-
}>;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.handleResponse = handleResponse;
|
|
4
|
-
/**
|
|
5
|
-
* Handles the response from the API.
|
|
6
|
-
* @param {Response} response - The response object from the fetch call.
|
|
7
|
-
* @returns {Promise<{status: number, responseBody: any}>} A promise that resolves to an object containing the status and response body.
|
|
8
|
-
*/
|
|
9
|
-
async function handleResponse(response) {
|
|
10
|
-
/** Handle cases where the response might not have a body (e.g., 204 No Content) */
|
|
11
|
-
const contentType = response.headers.get("content-type");
|
|
12
|
-
if (response.status === 204 || !contentType || !contentType.includes("application/json")) {
|
|
13
|
-
return {
|
|
14
|
-
status: response.status,
|
|
15
|
-
responseBody: await response.text()
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
const responseBody = await response.json();
|
|
19
|
-
return {
|
|
20
|
-
status: response.status,
|
|
21
|
-
responseBody: responseBody
|
|
22
|
-
};
|
|
23
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Logger } from "../base/logger";
|
|
2
|
-
export declare class BaseApi {
|
|
3
|
-
private logger;
|
|
4
|
-
constructor(logger: Logger);
|
|
5
|
-
get(url: string, options?: RequestInit): Promise<Response>;
|
|
6
|
-
post(url: string, options?: RequestInit): Promise<Response>;
|
|
7
|
-
put(url: string, options?: RequestInit): Promise<Response>;
|
|
8
|
-
delete(url: string, options?: RequestInit): Promise<Response>;
|
|
9
|
-
patch(url: string, options?: RequestInit): Promise<Response>;
|
|
10
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BaseApi = void 0;
|
|
4
|
-
class BaseApi {
|
|
5
|
-
logger;
|
|
6
|
-
constructor(logger) {
|
|
7
|
-
this.logger = logger;
|
|
8
|
-
}
|
|
9
|
-
async get(url, options) {
|
|
10
|
-
this.logger.info(`GET request to ${url}`);
|
|
11
|
-
return fetch(url, {
|
|
12
|
-
...options,
|
|
13
|
-
method: 'GET',
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
async post(url, options) {
|
|
17
|
-
this.logger.info(`POST request to ${url}`);
|
|
18
|
-
return fetch(url, {
|
|
19
|
-
...options,
|
|
20
|
-
method: 'POST',
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
async put(url, options) {
|
|
24
|
-
this.logger.info(`PUT request to ${url}`);
|
|
25
|
-
return fetch(url, {
|
|
26
|
-
...options,
|
|
27
|
-
method: 'PUT',
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
async delete(url, options) {
|
|
31
|
-
this.logger.info(`DELETE request to ${url}`);
|
|
32
|
-
return fetch(url, {
|
|
33
|
-
...options,
|
|
34
|
-
method: 'DELETE',
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
async patch(url, options) {
|
|
38
|
-
this.logger.info(`PATCH request to ${url}`);
|
|
39
|
-
return fetch(url, {
|
|
40
|
-
...options,
|
|
41
|
-
method: 'PATCH',
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
exports.BaseApi = BaseApi;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export declare enum Channel {
|
|
2
|
-
WEB = "web",
|
|
3
|
-
IOS = "ios",
|
|
4
|
-
ANDROID = "android",
|
|
5
|
-
IOSTEST = "iostest"
|
|
6
|
-
}
|
|
7
|
-
export declare enum Context {
|
|
8
|
-
DEFAULT = "/sfly/shutterfly/shutterfly-us/default"
|
|
9
|
-
}
|
|
10
|
-
export declare enum SearchType {
|
|
11
|
-
KEYWORD = "keyword"
|
|
12
|
-
}
|
|
13
|
-
export declare enum AssetType {
|
|
14
|
-
EMBELLISHMENT = "embellishment",
|
|
15
|
-
LAYOUT = "layout",
|
|
16
|
-
BACKGROUND = "background"
|
|
17
|
-
}
|
|
18
|
-
export declare enum DocType {
|
|
19
|
-
DOCUMENT = "document",
|
|
20
|
-
PRODUCT_CODE = "productCode",
|
|
21
|
-
SKU_CODE = "skuCode",
|
|
22
|
-
SELLABLE_PRODUCT_ID = "sellableProductId",
|
|
23
|
-
SELLABLE_PRODUCT_VARIANT_ID = "sellableProductVariantId"
|
|
24
|
-
}
|
|
25
|
-
export declare enum PublishState {
|
|
26
|
-
PUBLISHED_TO_PROD = "PUBLISHED_TO_PROD",
|
|
27
|
-
PUBLISHED_TO_STAGE = "PUBLISHED_TO_STAGE",
|
|
28
|
-
UNPUBLISHED = "UNPUBLISHED"
|
|
29
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PublishState = exports.DocType = exports.AssetType = exports.SearchType = exports.Context = exports.Channel = void 0;
|
|
4
|
-
var Channel;
|
|
5
|
-
(function (Channel) {
|
|
6
|
-
Channel["WEB"] = "web";
|
|
7
|
-
Channel["IOS"] = "ios";
|
|
8
|
-
Channel["ANDROID"] = "android";
|
|
9
|
-
Channel["IOSTEST"] = "iostest";
|
|
10
|
-
})(Channel || (exports.Channel = Channel = {}));
|
|
11
|
-
var Context;
|
|
12
|
-
(function (Context) {
|
|
13
|
-
Context["DEFAULT"] = "/sfly/shutterfly/shutterfly-us/default";
|
|
14
|
-
})(Context || (exports.Context = Context = {}));
|
|
15
|
-
var SearchType;
|
|
16
|
-
(function (SearchType) {
|
|
17
|
-
SearchType["KEYWORD"] = "keyword";
|
|
18
|
-
})(SearchType || (exports.SearchType = SearchType = {}));
|
|
19
|
-
var AssetType;
|
|
20
|
-
(function (AssetType) {
|
|
21
|
-
AssetType["EMBELLISHMENT"] = "embellishment";
|
|
22
|
-
AssetType["LAYOUT"] = "layout";
|
|
23
|
-
AssetType["BACKGROUND"] = "background";
|
|
24
|
-
})(AssetType || (exports.AssetType = AssetType = {}));
|
|
25
|
-
var DocType;
|
|
26
|
-
(function (DocType) {
|
|
27
|
-
DocType["DOCUMENT"] = "document";
|
|
28
|
-
DocType["PRODUCT_CODE"] = "productCode";
|
|
29
|
-
DocType["SKU_CODE"] = "skuCode";
|
|
30
|
-
DocType["SELLABLE_PRODUCT_ID"] = "sellableProductId";
|
|
31
|
-
DocType["SELLABLE_PRODUCT_VARIANT_ID"] = "sellableProductVariantId";
|
|
32
|
-
})(DocType || (exports.DocType = DocType = {}));
|
|
33
|
-
var PublishState;
|
|
34
|
-
(function (PublishState) {
|
|
35
|
-
PublishState["PUBLISHED_TO_PROD"] = "PUBLISHED_TO_PROD";
|
|
36
|
-
PublishState["PUBLISHED_TO_STAGE"] = "PUBLISHED_TO_STAGE";
|
|
37
|
-
PublishState["UNPUBLISHED"] = "UNPUBLISHED";
|
|
38
|
-
})(PublishState || (exports.PublishState = PublishState = {}));
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare const tags: {
|
|
2
|
-
REGRESSION: string;
|
|
3
|
-
SMOKE: string;
|
|
4
|
-
ACCOUNTSAPI: string;
|
|
5
|
-
CREATION: string;
|
|
6
|
-
CALENDAR: string;
|
|
7
|
-
PHOTOBOOK: string;
|
|
8
|
-
CARDS: string;
|
|
9
|
-
PRINTS: string;
|
|
10
|
-
DIGITALDATA: string;
|
|
11
|
-
DEMO: string;
|
|
12
|
-
CATALOGSEARCHAPI: string;
|
|
13
|
-
DESIGNPORTALAPI: string;
|
|
14
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.tags = void 0;
|
|
4
|
-
exports.tags = {
|
|
5
|
-
REGRESSION: "@regression",
|
|
6
|
-
SMOKE: "@smoke",
|
|
7
|
-
ACCOUNTSAPI: "@accountsapi",
|
|
8
|
-
CREATION: "@creation",
|
|
9
|
-
CALENDAR: "@calendar",
|
|
10
|
-
PHOTOBOOK: "@photobook",
|
|
11
|
-
CARDS: "@cards",
|
|
12
|
-
PRINTS: "@prints",
|
|
13
|
-
DIGITALDATA: '@digitaldata',
|
|
14
|
-
DEMO: "@demo",
|
|
15
|
-
CATALOGSEARCHAPI: "@catalogsearchapi",
|
|
16
|
-
DESIGNPORTALAPI: "@designportalapi",
|
|
17
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { BasePageActions } from './base/basepageactions';
|
|
2
|
-
import { BasePageValidations } from './base/basepagevalidations';
|
|
3
|
-
import { BasePageWaits } from './base/basepagewaits';
|
|
4
|
-
import { NetworkUtils } from './utils/networkutils';
|
|
5
|
-
import { BaseApi } from './baseapi/baseapihelpers';
|
|
6
|
-
import { CommonPageActions } from './base/commonpageactions';
|
|
7
|
-
import { Logger } from './base/logger';
|
|
8
|
-
import path = require('path');
|
|
9
|
-
import fs = require('fs');
|
|
10
|
-
type MyFixtures = {
|
|
11
|
-
logger: Logger;
|
|
12
|
-
actions: BasePageActions;
|
|
13
|
-
validations: BasePageValidations;
|
|
14
|
-
waits: BasePageWaits;
|
|
15
|
-
networkUtils: NetworkUtils;
|
|
16
|
-
baseApi: BaseApi;
|
|
17
|
-
commonPageActions: CommonPageActions;
|
|
18
|
-
};
|
|
19
|
-
export declare const test: import("@playwright/test").TestType<import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & MyFixtures, import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions>;
|
|
20
|
-
export declare const expect: import("@playwright/test").Expect<{}>;
|
|
21
|
-
export { tags } from './constants/test-tags';
|
|
22
|
-
export * from './constants/apiconstants';
|
|
23
|
-
export { path, fs };
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.fs = exports.path = exports.tags = exports.expect = exports.test = void 0;
|
|
18
|
-
const test_1 = require("@playwright/test");
|
|
19
|
-
const basepageactions_1 = require("./base/basepageactions");
|
|
20
|
-
const basepagevalidations_1 = require("./base/basepagevalidations");
|
|
21
|
-
const basepagewaits_1 = require("./base/basepagewaits");
|
|
22
|
-
const networkutils_1 = require("./utils/networkutils");
|
|
23
|
-
const baseapihelpers_1 = require("./baseapi/baseapihelpers");
|
|
24
|
-
const commonpageactions_1 = require("./base/commonpageactions");
|
|
25
|
-
const logger_1 = require("./base/logger");
|
|
26
|
-
const path = require("path");
|
|
27
|
-
exports.path = path;
|
|
28
|
-
const fs = require("fs");
|
|
29
|
-
exports.fs = fs;
|
|
30
|
-
exports.test = test_1.test.extend({
|
|
31
|
-
logger: async ({}, use, testInfo) => {
|
|
32
|
-
const logger = new logger_1.Logger(testInfo.title);
|
|
33
|
-
await use(logger);
|
|
34
|
-
},
|
|
35
|
-
/**
|
|
36
|
-
* Fixture for BasePageActions.
|
|
37
|
-
*/
|
|
38
|
-
actions: async ({ page, logger }, use) => {
|
|
39
|
-
const actions = new basepageactions_1.BasePageActions(page, logger);
|
|
40
|
-
await use(actions);
|
|
41
|
-
},
|
|
42
|
-
/**
|
|
43
|
-
* Fixture for BasePageValidations.
|
|
44
|
-
*/
|
|
45
|
-
validations: async ({ page, logger }, use) => {
|
|
46
|
-
const basePageValidations = new basepagevalidations_1.BasePageValidations(page, logger);
|
|
47
|
-
await use(basePageValidations);
|
|
48
|
-
},
|
|
49
|
-
/**
|
|
50
|
-
* Fixture for BasePageWaits.
|
|
51
|
-
*/
|
|
52
|
-
waits: async ({ page, logger }, use) => {
|
|
53
|
-
const waits = new basepagewaits_1.BasePageWaits(page, logger);
|
|
54
|
-
await use(waits);
|
|
55
|
-
},
|
|
56
|
-
/**
|
|
57
|
-
* Fixture for NetworkUtils.
|
|
58
|
-
*/
|
|
59
|
-
networkUtils: async ({ page, logger }, use) => {
|
|
60
|
-
const networkUtils = new networkutils_1.NetworkUtils(page, logger);
|
|
61
|
-
await use(networkUtils);
|
|
62
|
-
},
|
|
63
|
-
/**
|
|
64
|
-
* Fixture for the BaseApi.
|
|
65
|
-
*/
|
|
66
|
-
baseApi: async ({ logger }, use) => {
|
|
67
|
-
const baseApi = new baseapihelpers_1.BaseApi(logger);
|
|
68
|
-
await use(baseApi);
|
|
69
|
-
},
|
|
70
|
-
/**
|
|
71
|
-
* Fixture for CommonPageActions.
|
|
72
|
-
*/
|
|
73
|
-
commonPageActions: async ({ page, logger }, use) => {
|
|
74
|
-
const commonPageActions = new commonpageactions_1.CommonPageActions(page, logger);
|
|
75
|
-
await use(commonPageActions);
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
exports.expect = exports.test.expect;
|
|
79
|
-
var test_tags_1 = require("./constants/test-tags");
|
|
80
|
-
Object.defineProperty(exports, "tags", { enumerable: true, get: function () { return test_tags_1.tags; } });
|
|
81
|
-
__exportStar(require("./constants/apiconstants"), exports);
|