angular-uitest 1.0.3
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/LICENSE +21 -0
- package/README.md +336 -0
- package/bin/samaro-allure.mjs +178 -0
- package/bin/samaro-init.mjs +407 -0
- package/bin/samaro-test.mjs +119 -0
- package/dist/cjs/config/index.d.ts +4 -0
- package/dist/cjs/config/index.d.ts.map +1 -0
- package/dist/cjs/config/index.js +11 -0
- package/dist/cjs/config/index.js.map +1 -0
- package/dist/cjs/config/playwright.component.config.d.ts +12 -0
- package/dist/cjs/config/playwright.component.config.d.ts.map +1 -0
- package/dist/cjs/config/playwright.component.config.js +42 -0
- package/dist/cjs/config/playwright.component.config.js.map +1 -0
- package/dist/cjs/config/playwright.config.d.ts +14 -0
- package/dist/cjs/config/playwright.config.d.ts.map +1 -0
- package/dist/cjs/config/playwright.config.js +53 -0
- package/dist/cjs/config/playwright.config.js.map +1 -0
- package/dist/cjs/config/vitest.config.d.ts +12 -0
- package/dist/cjs/config/vitest.config.d.ts.map +1 -0
- package/dist/cjs/config/vitest.config.js +60 -0
- package/dist/cjs/config/vitest.config.js.map +1 -0
- package/dist/cjs/helpers/allure.d.ts +141 -0
- package/dist/cjs/helpers/allure.d.ts.map +1 -0
- package/dist/cjs/helpers/allure.js +331 -0
- package/dist/cjs/helpers/allure.js.map +1 -0
- package/dist/cjs/helpers/api.d.ts +69 -0
- package/dist/cjs/helpers/api.d.ts.map +1 -0
- package/dist/cjs/helpers/api.js +163 -0
- package/dist/cjs/helpers/api.js.map +1 -0
- package/dist/cjs/helpers/auth.d.ts +35 -0
- package/dist/cjs/helpers/auth.d.ts.map +1 -0
- package/dist/cjs/helpers/auth.js +104 -0
- package/dist/cjs/helpers/auth.js.map +1 -0
- package/dist/cjs/helpers/config.d.ts +34 -0
- package/dist/cjs/helpers/config.d.ts.map +1 -0
- package/dist/cjs/helpers/config.js +70 -0
- package/dist/cjs/helpers/config.js.map +1 -0
- package/dist/cjs/helpers/debug.d.ts +48 -0
- package/dist/cjs/helpers/debug.d.ts.map +1 -0
- package/dist/cjs/helpers/debug.js +86 -0
- package/dist/cjs/helpers/debug.js.map +1 -0
- package/dist/cjs/helpers/index.d.ts +8 -0
- package/dist/cjs/helpers/index.d.ts.map +1 -0
- package/dist/cjs/helpers/index.js +76 -0
- package/dist/cjs/helpers/index.js.map +1 -0
- package/dist/cjs/helpers/setup.d.ts +50 -0
- package/dist/cjs/helpers/setup.d.ts.map +1 -0
- package/dist/cjs/helpers/setup.js +137 -0
- package/dist/cjs/helpers/setup.js.map +1 -0
- package/dist/cjs/src/index.d.ts +17 -0
- package/dist/cjs/src/index.d.ts.map +1 -0
- package/dist/cjs/src/index.js +99 -0
- package/dist/cjs/src/index.js.map +1 -0
- package/dist/esm/config/index.d.ts +4 -0
- package/dist/esm/config/index.d.ts.map +1 -0
- package/dist/esm/config/index.mjs +4 -0
- package/dist/esm/config/index.mjs.map +1 -0
- package/dist/esm/config/playwright.component.config.d.ts +12 -0
- package/dist/esm/config/playwright.component.config.d.ts.map +1 -0
- package/dist/esm/config/playwright.component.config.mjs +39 -0
- package/dist/esm/config/playwright.component.config.mjs.map +1 -0
- package/dist/esm/config/playwright.config.d.ts +14 -0
- package/dist/esm/config/playwright.config.d.ts.map +1 -0
- package/dist/esm/config/playwright.config.mjs +50 -0
- package/dist/esm/config/playwright.config.mjs.map +1 -0
- package/dist/esm/config/vitest.config.d.ts +12 -0
- package/dist/esm/config/vitest.config.d.ts.map +1 -0
- package/dist/esm/config/vitest.config.mjs +56 -0
- package/dist/esm/config/vitest.config.mjs.map +1 -0
- package/dist/esm/helpers/allure.d.ts +141 -0
- package/dist/esm/helpers/allure.d.ts.map +1 -0
- package/dist/esm/helpers/allure.mjs +306 -0
- package/dist/esm/helpers/allure.mjs.map +1 -0
- package/dist/esm/helpers/api.d.ts +69 -0
- package/dist/esm/helpers/api.d.ts.map +1 -0
- package/dist/esm/helpers/api.mjs +154 -0
- package/dist/esm/helpers/api.mjs.map +1 -0
- package/dist/esm/helpers/auth.d.ts +35 -0
- package/dist/esm/helpers/auth.d.ts.map +1 -0
- package/dist/esm/helpers/auth.mjs +96 -0
- package/dist/esm/helpers/auth.mjs.map +1 -0
- package/dist/esm/helpers/config.d.ts +34 -0
- package/dist/esm/helpers/config.d.ts.map +1 -0
- package/dist/esm/helpers/config.mjs +63 -0
- package/dist/esm/helpers/config.mjs.map +1 -0
- package/dist/esm/helpers/debug.d.ts +48 -0
- package/dist/esm/helpers/debug.d.ts.map +1 -0
- package/dist/esm/helpers/debug.mjs +76 -0
- package/dist/esm/helpers/debug.mjs.map +1 -0
- package/dist/esm/helpers/index.d.ts +8 -0
- package/dist/esm/helpers/index.d.ts.map +1 -0
- package/dist/esm/helpers/index.mjs +19 -0
- package/dist/esm/helpers/index.mjs.map +1 -0
- package/dist/esm/helpers/setup.d.ts +50 -0
- package/dist/esm/helpers/setup.d.ts.map +1 -0
- package/dist/esm/helpers/setup.mjs +95 -0
- package/dist/esm/helpers/setup.mjs.map +1 -0
- package/dist/esm/src/index.d.ts +17 -0
- package/dist/esm/src/index.d.ts.map +1 -0
- package/dist/esm/src/index.mjs +40 -0
- package/dist/esm/src/index.mjs.map +1 -0
- package/dist/types/config/index.d.ts +4 -0
- package/dist/types/config/index.d.ts.map +1 -0
- package/dist/types/config/playwright.component.config.d.ts +12 -0
- package/dist/types/config/playwright.component.config.d.ts.map +1 -0
- package/dist/types/config/playwright.config.d.ts +14 -0
- package/dist/types/config/playwright.config.d.ts.map +1 -0
- package/dist/types/config/vitest.config.d.ts +12 -0
- package/dist/types/config/vitest.config.d.ts.map +1 -0
- package/dist/types/helpers/allure.d.ts +141 -0
- package/dist/types/helpers/allure.d.ts.map +1 -0
- package/dist/types/helpers/api.d.ts +69 -0
- package/dist/types/helpers/api.d.ts.map +1 -0
- package/dist/types/helpers/auth.d.ts +35 -0
- package/dist/types/helpers/auth.d.ts.map +1 -0
- package/dist/types/helpers/config.d.ts +34 -0
- package/dist/types/helpers/config.d.ts.map +1 -0
- package/dist/types/helpers/debug.d.ts +48 -0
- package/dist/types/helpers/debug.d.ts.map +1 -0
- package/dist/types/helpers/index.d.ts +8 -0
- package/dist/types/helpers/index.d.ts.map +1 -0
- package/dist/types/helpers/setup.d.ts +50 -0
- package/dist/types/helpers/setup.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +17 -0
- package/dist/types/src/index.d.ts.map +1 -0
- package/package.json +140 -0
- package/schematics/collection.json +11 -0
- package/schematics/ng-add/index.js +126 -0
- package/schematics/ng-add/schema.json +26 -0
- package/scripts/check-allure-results.mjs +300 -0
- package/scripts/rename-esm-files.mjs +76 -0
- package/types/allure.d.ts +76 -0
- package/types/global.d.ts +49 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.attachScreenshot = exports.addAttachment = exports.addLink = exports.addLabel = exports.allureMeta = exports.allure = exports.tms = exports.issue = exports.link = exports.descriptionHtml = exports.description = exports.owner = exports.story = exports.feature = exports.epic = exports.tag = exports.severity = exports.setTestEnv = exports.getBrowserLaunchOptions = exports.isDebug = exports.isCI = exports.getConfig = exports.safeGoto = exports.waitForAngular = exports.cleanupTestData = exports.createManyArticles = exports.setupAuthenticatedPage = exports.createUserViaAPI = exports.createUserInIsolation = exports.getCurrentUserViaAPI = exports.updateUserViaAPI = exports.deleteArticleViaAPI = exports.createArticleViaAPI = exports.loginUserViaAPI = exports.registerUserViaAPI = exports.getAPIConfig = exports.getCurrentUsername = exports.isLoggedIn = exports.generateUniqueUser = exports.logout = exports.login = exports.register = exports.getDebugData = exports.isDebugInterfaceAvailable = exports.waitForAuthState = exports.getCurrentUser = exports.getAuthState = exports.getToken = exports.getDebugInterfaceName = exports.setDebugInterfaceName = void 0;
|
|
4
|
+
exports.getAllureMetadataKeys = exports.getAllureMetadata = exports.allureStep = exports.attachHtml = exports.attachText = exports.attachJson = void 0;
|
|
5
|
+
// Debug interface helpers
|
|
6
|
+
var debug_js_1 = require("./debug.js");
|
|
7
|
+
Object.defineProperty(exports, "setDebugInterfaceName", { enumerable: true, get: function () { return debug_js_1.setDebugInterfaceName; } });
|
|
8
|
+
Object.defineProperty(exports, "getDebugInterfaceName", { enumerable: true, get: function () { return debug_js_1.getDebugInterfaceName; } });
|
|
9
|
+
Object.defineProperty(exports, "getToken", { enumerable: true, get: function () { return debug_js_1.getToken; } });
|
|
10
|
+
Object.defineProperty(exports, "getAuthState", { enumerable: true, get: function () { return debug_js_1.getAuthState; } });
|
|
11
|
+
Object.defineProperty(exports, "getCurrentUser", { enumerable: true, get: function () { return debug_js_1.getCurrentUser; } });
|
|
12
|
+
Object.defineProperty(exports, "waitForAuthState", { enumerable: true, get: function () { return debug_js_1.waitForAuthState; } });
|
|
13
|
+
Object.defineProperty(exports, "isDebugInterfaceAvailable", { enumerable: true, get: function () { return debug_js_1.isDebugInterfaceAvailable; } });
|
|
14
|
+
Object.defineProperty(exports, "getDebugData", { enumerable: true, get: function () { return debug_js_1.getDebugData; } });
|
|
15
|
+
// Authentication helpers
|
|
16
|
+
var auth_js_1 = require("./auth.js");
|
|
17
|
+
Object.defineProperty(exports, "register", { enumerable: true, get: function () { return auth_js_1.register; } });
|
|
18
|
+
Object.defineProperty(exports, "login", { enumerable: true, get: function () { return auth_js_1.login; } });
|
|
19
|
+
Object.defineProperty(exports, "logout", { enumerable: true, get: function () { return auth_js_1.logout; } });
|
|
20
|
+
Object.defineProperty(exports, "generateUniqueUser", { enumerable: true, get: function () { return auth_js_1.generateUniqueUser; } });
|
|
21
|
+
Object.defineProperty(exports, "isLoggedIn", { enumerable: true, get: function () { return auth_js_1.isLoggedIn; } });
|
|
22
|
+
Object.defineProperty(exports, "getCurrentUsername", { enumerable: true, get: function () { return auth_js_1.getCurrentUsername; } });
|
|
23
|
+
// API helpers
|
|
24
|
+
var api_js_1 = require("./api.js");
|
|
25
|
+
Object.defineProperty(exports, "getAPIConfig", { enumerable: true, get: function () { return api_js_1.getAPIConfig; } });
|
|
26
|
+
Object.defineProperty(exports, "registerUserViaAPI", { enumerable: true, get: function () { return api_js_1.registerUserViaAPI; } });
|
|
27
|
+
Object.defineProperty(exports, "loginUserViaAPI", { enumerable: true, get: function () { return api_js_1.loginUserViaAPI; } });
|
|
28
|
+
Object.defineProperty(exports, "createArticleViaAPI", { enumerable: true, get: function () { return api_js_1.createArticleViaAPI; } });
|
|
29
|
+
Object.defineProperty(exports, "deleteArticleViaAPI", { enumerable: true, get: function () { return api_js_1.deleteArticleViaAPI; } });
|
|
30
|
+
Object.defineProperty(exports, "updateUserViaAPI", { enumerable: true, get: function () { return api_js_1.updateUserViaAPI; } });
|
|
31
|
+
Object.defineProperty(exports, "getCurrentUserViaAPI", { enumerable: true, get: function () { return api_js_1.getCurrentUserViaAPI; } });
|
|
32
|
+
// Setup utilities
|
|
33
|
+
var setup_js_1 = require("./setup.js");
|
|
34
|
+
Object.defineProperty(exports, "createUserInIsolation", { enumerable: true, get: function () { return setup_js_1.createUserInIsolation; } });
|
|
35
|
+
Object.defineProperty(exports, "createUserViaAPI", { enumerable: true, get: function () { return setup_js_1.createUserViaAPI; } });
|
|
36
|
+
Object.defineProperty(exports, "setupAuthenticatedPage", { enumerable: true, get: function () { return setup_js_1.setupAuthenticatedPage; } });
|
|
37
|
+
Object.defineProperty(exports, "createManyArticles", { enumerable: true, get: function () { return setup_js_1.createManyArticles; } });
|
|
38
|
+
Object.defineProperty(exports, "cleanupTestData", { enumerable: true, get: function () { return setup_js_1.cleanupTestData; } });
|
|
39
|
+
Object.defineProperty(exports, "waitForAngular", { enumerable: true, get: function () { return setup_js_1.waitForAngular; } });
|
|
40
|
+
Object.defineProperty(exports, "safeGoto", { enumerable: true, get: function () { return setup_js_1.safeGoto; } });
|
|
41
|
+
// Configuration helpers
|
|
42
|
+
var config_js_1 = require("./config.js");
|
|
43
|
+
Object.defineProperty(exports, "getConfig", { enumerable: true, get: function () { return config_js_1.getConfig; } });
|
|
44
|
+
Object.defineProperty(exports, "isCI", { enumerable: true, get: function () { return config_js_1.isCI; } });
|
|
45
|
+
Object.defineProperty(exports, "isDebug", { enumerable: true, get: function () { return config_js_1.isDebug; } });
|
|
46
|
+
Object.defineProperty(exports, "getBrowserLaunchOptions", { enumerable: true, get: function () { return config_js_1.getBrowserLaunchOptions; } });
|
|
47
|
+
Object.defineProperty(exports, "setTestEnv", { enumerable: true, get: function () { return config_js_1.setTestEnv; } });
|
|
48
|
+
// Allure metadata helpers
|
|
49
|
+
var allure_js_1 = require("./allure.js");
|
|
50
|
+
// Decorators
|
|
51
|
+
Object.defineProperty(exports, "severity", { enumerable: true, get: function () { return allure_js_1.severity; } });
|
|
52
|
+
Object.defineProperty(exports, "tag", { enumerable: true, get: function () { return allure_js_1.tag; } });
|
|
53
|
+
Object.defineProperty(exports, "epic", { enumerable: true, get: function () { return allure_js_1.epic; } });
|
|
54
|
+
Object.defineProperty(exports, "feature", { enumerable: true, get: function () { return allure_js_1.feature; } });
|
|
55
|
+
Object.defineProperty(exports, "story", { enumerable: true, get: function () { return allure_js_1.story; } });
|
|
56
|
+
Object.defineProperty(exports, "owner", { enumerable: true, get: function () { return allure_js_1.owner; } });
|
|
57
|
+
Object.defineProperty(exports, "description", { enumerable: true, get: function () { return allure_js_1.description; } });
|
|
58
|
+
Object.defineProperty(exports, "descriptionHtml", { enumerable: true, get: function () { return allure_js_1.descriptionHtml; } });
|
|
59
|
+
Object.defineProperty(exports, "link", { enumerable: true, get: function () { return allure_js_1.link; } });
|
|
60
|
+
Object.defineProperty(exports, "issue", { enumerable: true, get: function () { return allure_js_1.issue; } });
|
|
61
|
+
Object.defineProperty(exports, "tms", { enumerable: true, get: function () { return allure_js_1.tms; } });
|
|
62
|
+
Object.defineProperty(exports, "allure", { enumerable: true, get: function () { return allure_js_1.allure; } });
|
|
63
|
+
// Runtime helpers
|
|
64
|
+
Object.defineProperty(exports, "allureMeta", { enumerable: true, get: function () { return allure_js_1.allureMeta; } });
|
|
65
|
+
Object.defineProperty(exports, "addLabel", { enumerable: true, get: function () { return allure_js_1.addLabel; } });
|
|
66
|
+
Object.defineProperty(exports, "addLink", { enumerable: true, get: function () { return allure_js_1.addLink; } });
|
|
67
|
+
Object.defineProperty(exports, "addAttachment", { enumerable: true, get: function () { return allure_js_1.addAttachment; } });
|
|
68
|
+
Object.defineProperty(exports, "attachScreenshot", { enumerable: true, get: function () { return allure_js_1.attachScreenshot; } });
|
|
69
|
+
Object.defineProperty(exports, "attachJson", { enumerable: true, get: function () { return allure_js_1.attachJson; } });
|
|
70
|
+
Object.defineProperty(exports, "attachText", { enumerable: true, get: function () { return allure_js_1.attachText; } });
|
|
71
|
+
Object.defineProperty(exports, "attachHtml", { enumerable: true, get: function () { return allure_js_1.attachHtml; } });
|
|
72
|
+
Object.defineProperty(exports, "allureStep", { enumerable: true, get: function () { return allure_js_1.allureStep; } });
|
|
73
|
+
// Metadata utilities
|
|
74
|
+
Object.defineProperty(exports, "getAllureMetadata", { enumerable: true, get: function () { return allure_js_1.getAllureMetadata; } });
|
|
75
|
+
Object.defineProperty(exports, "getAllureMetadataKeys", { enumerable: true, get: function () { return allure_js_1.getAllureMetadataKeys; } });
|
|
76
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../helpers/index.ts"],"names":[],"mappings":";;;;AAAA,0BAA0B;AAC1B,uCAWoB;AAVlB,iHAAA,qBAAqB,OAAA;AACrB,iHAAA,qBAAqB,OAAA;AACrB,oGAAA,QAAQ,OAAA;AACR,wGAAA,YAAY,OAAA;AACZ,0GAAA,cAAc,OAAA;AACd,4GAAA,gBAAgB,OAAA;AAChB,qHAAA,yBAAyB,OAAA;AACzB,wGAAA,YAAY,OAAA;AAKd,yBAAyB;AACzB,qCASmB;AARjB,mGAAA,QAAQ,OAAA;AACR,gGAAA,KAAK,OAAA;AACL,iGAAA,MAAM,OAAA;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U,OAAA;AAEV,qBAAqB;AACrB,8GAAA,iBAAiB,OAAA;AACjB,kHAAA,qBAAqB,OAAA"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Browser, BrowserContext, Page, APIRequestContext } from '@playwright/test';
|
|
2
|
+
import { APIUser } from './api.js';
|
|
3
|
+
export interface TestUser extends APIUser {
|
|
4
|
+
token?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface IsolatedUserContext {
|
|
7
|
+
context: BrowserContext;
|
|
8
|
+
page: Page;
|
|
9
|
+
user: TestUser;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Create a user in an isolated browser context
|
|
13
|
+
* This provides full isolation for tests
|
|
14
|
+
*/
|
|
15
|
+
export declare function createUserInIsolation(browser: Browser, user?: Partial<TestUser>): Promise<IsolatedUserContext>;
|
|
16
|
+
/**
|
|
17
|
+
* Create a user via API (faster, no browser context needed)
|
|
18
|
+
*/
|
|
19
|
+
export declare function createUserViaAPI(request: APIRequestContext, user?: Partial<TestUser>): Promise<TestUser & {
|
|
20
|
+
token: string;
|
|
21
|
+
}>;
|
|
22
|
+
/**
|
|
23
|
+
* Setup authenticated page with token
|
|
24
|
+
*/
|
|
25
|
+
export declare function setupAuthenticatedPage(page: Page, token: string): Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* Create multiple articles via API
|
|
28
|
+
*/
|
|
29
|
+
export declare function createManyArticles(request: APIRequestContext, token: string, count: number, baseTitle?: string): Promise<Array<{
|
|
30
|
+
slug: string;
|
|
31
|
+
title: string;
|
|
32
|
+
}>>;
|
|
33
|
+
/**
|
|
34
|
+
* Cleanup helper for test data
|
|
35
|
+
*/
|
|
36
|
+
export declare function cleanupTestData(request: APIRequestContext, token: string, articles: Array<{
|
|
37
|
+
slug: string;
|
|
38
|
+
}>): Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* Wait for Angular to be stable
|
|
41
|
+
*/
|
|
42
|
+
export declare function waitForAngular(page: Page): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* Safe navigation with retry
|
|
45
|
+
*/
|
|
46
|
+
export declare function safeGoto(page: Page, url: string, options?: {
|
|
47
|
+
timeout?: number;
|
|
48
|
+
retries?: number;
|
|
49
|
+
}): Promise<void>;
|
|
50
|
+
//# sourceMappingURL=setup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../../helpers/setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAEpF,OAAO,EAAsB,OAAO,EAAE,MAAM,UAAU,CAAC;AAEvD,MAAM,WAAW,QAAS,SAAQ,OAAO;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,cAAc,CAAC;IACxB,IAAI,EAAE,IAAI,CAAC;IACX,IAAI,EAAE,QAAQ,CAAC;CAChB;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,OAAO,EAChB,IAAI,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,GACvB,OAAO,CAAC,mBAAmB,CAAC,CAa9B;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,iBAAiB,EAC1B,IAAI,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,GACvB,OAAO,CAAC,QAAQ,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CASvC;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,IAAI,CAAC,CASf;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,iBAAiB,EAC1B,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,SAAS,GAAE,MAAuB,GACjC,OAAO,CAAC,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAejD;AAED;;GAEG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,iBAAiB,EAC1B,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,GAChC,OAAO,CAAC,IAAI,CAAC,CAUf;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAK9D;AAED;;GAEG;AACH,wBAAsB,QAAQ,CAC5B,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,MAAM,EACX,OAAO,GAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAO,GACnD,OAAO,CAAC,IAAI,CAAC,CAYf"}
|
|
@@ -0,0 +1,137 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.createUserInIsolation = createUserInIsolation;
|
|
37
|
+
exports.createUserViaAPI = createUserViaAPI;
|
|
38
|
+
exports.setupAuthenticatedPage = setupAuthenticatedPage;
|
|
39
|
+
exports.createManyArticles = createManyArticles;
|
|
40
|
+
exports.cleanupTestData = cleanupTestData;
|
|
41
|
+
exports.waitForAngular = waitForAngular;
|
|
42
|
+
exports.safeGoto = safeGoto;
|
|
43
|
+
const auth_js_1 = require("./auth.js");
|
|
44
|
+
const api_js_1 = require("./api.js");
|
|
45
|
+
/**
|
|
46
|
+
* Create a user in an isolated browser context
|
|
47
|
+
* This provides full isolation for tests
|
|
48
|
+
*/
|
|
49
|
+
async function createUserInIsolation(browser, user) {
|
|
50
|
+
const context = await browser.newContext();
|
|
51
|
+
const page = await context.newPage();
|
|
52
|
+
const uniqueUser = { ...(0, auth_js_1.generateUniqueUser)(), ...user };
|
|
53
|
+
const result = await (0, auth_js_1.register)(page, uniqueUser.username, uniqueUser.email, uniqueUser.password);
|
|
54
|
+
if (!result.success) {
|
|
55
|
+
await context.close();
|
|
56
|
+
throw new Error(result.error || 'Failed to create user in isolation');
|
|
57
|
+
}
|
|
58
|
+
return { context, page, user: uniqueUser };
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Create a user via API (faster, no browser context needed)
|
|
62
|
+
*/
|
|
63
|
+
async function createUserViaAPI(request, user) {
|
|
64
|
+
const uniqueUser = { ...(0, auth_js_1.generateUniqueUser)(), ...user };
|
|
65
|
+
const result = await (0, api_js_1.registerUserViaAPI)(request, uniqueUser);
|
|
66
|
+
return {
|
|
67
|
+
username: result.username,
|
|
68
|
+
email: result.email,
|
|
69
|
+
password: uniqueUser.password,
|
|
70
|
+
token: result.token
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Setup authenticated page with token
|
|
75
|
+
*/
|
|
76
|
+
async function setupAuthenticatedPage(page, token) {
|
|
77
|
+
// Set token in localStorage
|
|
78
|
+
await page.goto('/');
|
|
79
|
+
await page.evaluate((t) => {
|
|
80
|
+
localStorage.setItem('token', t);
|
|
81
|
+
}, token);
|
|
82
|
+
// Reload to apply token
|
|
83
|
+
await page.reload();
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Create multiple articles via API
|
|
87
|
+
*/
|
|
88
|
+
async function createManyArticles(request, token, count, baseTitle = 'Test Article') {
|
|
89
|
+
const { createArticleViaAPI } = await Promise.resolve().then(() => __importStar(require('./api.js')));
|
|
90
|
+
const articles = [];
|
|
91
|
+
for (let i = 0; i < count; i++) {
|
|
92
|
+
const article = await createArticleViaAPI(request, token, {
|
|
93
|
+
title: `${baseTitle} ${i + 1}`,
|
|
94
|
+
description: `Description for article ${i + 1}`,
|
|
95
|
+
body: `Body content for article ${i + 1}`,
|
|
96
|
+
tagList: ['test', `tag-${i}`],
|
|
97
|
+
});
|
|
98
|
+
articles.push(article);
|
|
99
|
+
}
|
|
100
|
+
return articles;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Cleanup helper for test data
|
|
104
|
+
*/
|
|
105
|
+
async function cleanupTestData(request, token, articles) {
|
|
106
|
+
const { deleteArticleViaAPI } = await Promise.resolve().then(() => __importStar(require('./api.js')));
|
|
107
|
+
await Promise.all(articles.map(article => deleteArticleViaAPI(request, token, article.slug).catch(() => {
|
|
108
|
+
// Ignore cleanup errors
|
|
109
|
+
})));
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Wait for Angular to be stable
|
|
113
|
+
*/
|
|
114
|
+
async function waitForAngular(page) {
|
|
115
|
+
await page.waitForFunction(() => {
|
|
116
|
+
return window.getAngularTestability ?
|
|
117
|
+
window.getAngularTestability().isStable() : true;
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Safe navigation with retry
|
|
122
|
+
*/
|
|
123
|
+
async function safeGoto(page, url, options = {}) {
|
|
124
|
+
const { timeout = 10000, retries = 3 } = options;
|
|
125
|
+
for (let i = 0; i < retries; i++) {
|
|
126
|
+
try {
|
|
127
|
+
await page.goto(url, { waitUntil: 'networkidle', timeout });
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
catch (error) {
|
|
131
|
+
if (i === retries - 1)
|
|
132
|
+
throw error;
|
|
133
|
+
await page.waitForTimeout(1000);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=setup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../../helpers/setup.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,sDAgBC;AAKD,4CAYC;AAKD,wDAYC;AAKD,gDAoBC;AAKD,0CAcC;AAKD,wCAKC;AAKD,4BAgBC;AA9ID,uCAAyD;AACzD,qCAAuD;AAYvD;;;GAGG;AACI,KAAK,UAAU,qBAAqB,CACzC,OAAgB,EAChB,IAAwB;IAExB,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,UAAU,EAAE,CAAC;IAC3C,MAAM,I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Ae,CAAC,GAAG,EAAE;QAC9B,OAAQ,MAAc,CAAC,qBAAqB,CAAC,CAAC;YAC3C,MAAc,CAAC,qBAAqB,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IAC9D,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,QAAQ,CAC5B,IAAU,EACV,GAAW,EACX,UAAkD,EAAE;IAEpD,MAAM,EAAE,OAAO,GAAG,KAAK,EAAE,OAAO,GAAG,CAAC,EAAE,GAAG,OAAO,CAAC;IAEjD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC;QACjC,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,CAAC;YAC5D,OAAO;QACT,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,KAAK,OAAO,GAAG,CAAC;gBAAE,MAAM,KAAK,CAAC;YACnC,MAAM,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SamaroUItest - Comprehensive Testing Framework for Angular
|
|
3
|
+
*
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
*/
|
|
6
|
+
import 'reflect-metadata';
|
|
7
|
+
export { createVitestConfig, createPlaywrightConfig, createComponentConfig, mergeConfig, type SamaroVitestOptions, type SamaroPlaywrightOptions, type SamaroComponentOptions, } from '../config/index.js';
|
|
8
|
+
export { setDebugInterfaceName, getDebugInterfaceName, getToken, getAuthState, getCurrentUser, waitForAuthState, isDebugInterfaceAvailable, getDebugData, type AuthState, type User, register, login, logout, generateUniqueUser, isLoggedIn, getCurrentUsername, type UserCredentials, type AuthResult, getAPIConfig, registerUserViaAPI, loginUserViaAPI, createArticleViaAPI, deleteArticleViaAPI, updateUserViaAPI, getCurrentUserViaAPI, type APIConfig, type APIUser, type APIAuthResponse, createUserInIsolation, createUserViaAPI, setupAuthenticatedPage, createManyArticles, cleanupTestData, waitForAngular, safeGoto, type TestUser, type IsolatedUserContext, getConfig, isCI, isDebug, getBrowserLaunchOptions, setTestEnv, type SamaroConfig, severity, tag, epic, feature, story, owner, description, descriptionHtml, link, issue, tms, allure, allureMeta, addLabel, addLink, addAttachment, attachScreenshot, attachJson, attachText, attachHtml, allureStep, getAllureMetadata, getAllureMetadataKeys, type Severity, type LinkType, type LabelName, type AllureMetadataOptions, type Label, type Link, type Parameter, type Attachment, type Status, type StatusDetails, type StepResult, type TestResult, type TestResultContainer, } from '../helpers/index.js';
|
|
9
|
+
/**
|
|
10
|
+
* Version of SamaroUItest
|
|
11
|
+
*/
|
|
12
|
+
export declare const VERSION = "1.0.2";
|
|
13
|
+
/**
|
|
14
|
+
* Check if the package is properly installed
|
|
15
|
+
*/
|
|
16
|
+
export declare function checkInstallation(): boolean;
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,kBAAkB,CAAC;AAG1B,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,qBAAqB,EACrB,WAAW,EACX,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,GAC5B,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAEL,qBAAqB,EACrB,qBAAqB,EACrB,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,yBAAyB,EACzB,YAAY,EACZ,KAAK,SAAS,EACd,KAAK,IAAI,EAGT,QAAQ,EACR,KAAK,EACL,MAAM,EACN,kBAAkB,EAClB,UAAU,EACV,kBAAkB,EAClB,KAAK,eAAe,EACpB,KAAK,UAAU,EAGf,YAAY,EACZ,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,KAAK,SAAS,EACd,KAAK,OAAO,EACZ,KAAK,eAAe,EAGpB,qBAAqB,EACrB,gBAAgB,EAChB,sBAAsB,EACtB,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,QAAQ,EACR,KAAK,QAAQ,EACb,KAAK,mBAAmB,EAGxB,SAAS,EACT,IAAI,EACJ,OAAO,EACP,uBAAuB,EACvB,UAAU,EACV,KAAK,YAAY,EAGjB,QAAQ,EACR,GAAG,EACH,IAAI,EACJ,OAAO,EACP,KAAK,EACL,KAAK,EACL,WAAW,EACX,eAAe,EACf,IAAI,EACJ,KAAK,EACL,GAAG,EACH,MAAM,EACN,UAAU,EACV,QAAQ,EACR,OAAO,EACP,aAAa,EACb,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACrB,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,qBAAqB,EAC1B,KAAK,KAAK,EACV,KAAK,IAAI,EACT,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,mBAAmB,GACzB,MAAM,qBAAqB,CAAC;AAE7B;;GAEG;AACH,eAAO,MAAM,OAAO,UAAU,CAAC;AAE/B;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAO3C"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* SamaroUItest - Comprehensive Testing Framework for Angular
|
|
4
|
+
*
|
|
5
|
+
* @packageDocumentation
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.allureMeta = exports.allure = exports.tms = exports.issue = exports.link = exports.descriptionHtml = exports.description = exports.owner = exports.story = exports.feature = exports.epic = exports.tag = exports.severity = exports.setTestEnv = exports.getBrowserLaunchOptions = exports.isDebug = exports.isCI = exports.getConfig = exports.safeGoto = exports.waitForAngular = exports.cleanupTestData = exports.createManyArticles = exports.setupAuthenticatedPage = exports.createUserViaAPI = exports.createUserInIsolation = exports.getCurrentUserViaAPI = exports.updateUserViaAPI = exports.deleteArticleViaAPI = exports.createArticleViaAPI = exports.loginUserViaAPI = exports.registerUserViaAPI = exports.getAPIConfig = exports.getCurrentUsername = exports.isLoggedIn = exports.generateUniqueUser = exports.logout = exports.login = exports.register = exports.getDebugData = exports.isDebugInterfaceAvailable = exports.waitForAuthState = exports.getCurrentUser = exports.getAuthState = exports.getToken = exports.getDebugInterfaceName = exports.setDebugInterfaceName = exports.mergeConfig = exports.createComponentConfig = exports.createPlaywrightConfig = exports.createVitestConfig = void 0;
|
|
9
|
+
exports.VERSION = exports.getAllureMetadataKeys = exports.getAllureMetadata = exports.allureStep = exports.attachHtml = exports.attachText = exports.attachJson = exports.attachScreenshot = exports.addAttachment = exports.addLink = exports.addLabel = void 0;
|
|
10
|
+
exports.checkInstallation = checkInstallation;
|
|
11
|
+
// Import reflect-metadata for decorator support
|
|
12
|
+
require("reflect-metadata");
|
|
13
|
+
// Configuration exports
|
|
14
|
+
var index_js_1 = require("../config/index.js");
|
|
15
|
+
Object.defineProperty(exports, "createVitestConfig", { enumerable: true, get: function () { return index_js_1.createVitestConfig; } });
|
|
16
|
+
Object.defineProperty(exports, "createPlaywrightConfig", { enumerable: true, get: function () { return index_js_1.createPlaywrightConfig; } });
|
|
17
|
+
Object.defineProperty(exports, "createComponentConfig", { enumerable: true, get: function () { return index_js_1.createComponentConfig; } });
|
|
18
|
+
Object.defineProperty(exports, "mergeConfig", { enumerable: true, get: function () { return index_js_1.mergeConfig; } });
|
|
19
|
+
// Helper exports
|
|
20
|
+
var index_js_2 = require("../helpers/index.js");
|
|
21
|
+
// Debug
|
|
22
|
+
Object.defineProperty(exports, "setDebugInterfaceName", { enumerable: true, get: function () { return index_js_2.setDebugInterfaceName; } });
|
|
23
|
+
Object.defineProperty(exports, "getDebugInterfaceName", { enumerable: true, get: function () { return index_js_2.getDebugInterfaceName; } });
|
|
24
|
+
Object.defineProperty(exports, "getToken", { enumerable: true, get: function () { return index_js_2.getToken; } });
|
|
25
|
+
Object.defineProperty(exports, "getAuthState", { enumerable: true, get: function () { return index_js_2.getAuthState; } });
|
|
26
|
+
Object.defineProperty(exports, "getCurrentUser", { enumerable: true, get: function () { return index_js_2.getCurrentUser; } });
|
|
27
|
+
Object.defineProperty(exports, "waitForAuthState", { enumerable: true, get: function () { return index_js_2.waitForAuthState; } });
|
|
28
|
+
Object.defineProperty(exports, "isDebugInterfaceAvailable", { enumerable: true, get: function () { return index_js_2.isDebugInterfaceAvailable; } });
|
|
29
|
+
Object.defineProperty(exports, "getDebugData", { enumerable: true, get: function () { return index_js_2.getDebugData; } });
|
|
30
|
+
// Auth
|
|
31
|
+
Object.defineProperty(exports, "register", { enumerable: true, get: function () { return index_js_2.register; } });
|
|
32
|
+
Object.defineProperty(exports, "login", { enumerable: true, get: function () { return index_js_2.login; } });
|
|
33
|
+
Object.defineProperty(exports, "logout", { enumerable: true, get: function () { return index_js_2.logout; } });
|
|
34
|
+
Object.defineProperty(exports, "generateUniqueUser", { enumerable: true, get: function () { return index_js_2.generateUniqueUser; } });
|
|
35
|
+
Object.defineProperty(exports, "isLoggedIn", { enumerable: true, get: function () { return index_js_2.isLoggedIn; } });
|
|
36
|
+
Object.defineProperty(exports, "getCurrentUsername", { enumerable: true, get: function () { return index_js_2.getCurrentUsername; } });
|
|
37
|
+
// API
|
|
38
|
+
Object.defineProperty(exports, "getAPIConfig", { enumerable: true, get: function () { return index_js_2.getAPIConfig; } });
|
|
39
|
+
Object.defineProperty(exports, "registerUserViaAPI", { enumerable: true, get: function () { return index_js_2.registerUserViaAPI; } });
|
|
40
|
+
Object.defineProperty(exports, "loginUserViaAPI", { enumerable: true, get: function () { return index_js_2.loginUserViaAPI; } });
|
|
41
|
+
Object.defineProperty(exports, "createArticleViaAPI", { enumerable: true, get: function () { return index_js_2.createArticleViaAPI; } });
|
|
42
|
+
Object.defineProperty(exports, "deleteArticleViaAPI", { enumerable: true, get: function () { return index_js_2.deleteArticleViaAPI; } });
|
|
43
|
+
Object.defineProperty(exports, "updateUserViaAPI", { enumerable: true, get: function () { return index_js_2.updateUserViaAPI; } });
|
|
44
|
+
Object.defineProperty(exports, "getCurrentUserViaAPI", { enumerable: true, get: function () { return index_js_2.getCurrentUserViaAPI; } });
|
|
45
|
+
// Setup
|
|
46
|
+
Object.defineProperty(exports, "createUserInIsolation", { enumerable: true, get: function () { return index_js_2.createUserInIsolation; } });
|
|
47
|
+
Object.defineProperty(exports, "createUserViaAPI", { enumerable: true, get: function () { return index_js_2.createUserViaAPI; } });
|
|
48
|
+
Object.defineProperty(exports, "setupAuthenticatedPage", { enumerable: true, get: function () { return index_js_2.setupAuthenticatedPage; } });
|
|
49
|
+
Object.defineProperty(exports, "createManyArticles", { enumerable: true, get: function () { return index_js_2.createManyArticles; } });
|
|
50
|
+
Object.defineProperty(exports, "cleanupTestData", { enumerable: true, get: function () { return index_js_2.cleanupTestData; } });
|
|
51
|
+
Object.defineProperty(exports, "waitForAngular", { enumerable: true, get: function () { return index_js_2.waitForAngular; } });
|
|
52
|
+
Object.defineProperty(exports, "safeGoto", { enumerable: true, get: function () { return index_js_2.safeGoto; } });
|
|
53
|
+
// Config
|
|
54
|
+
Object.defineProperty(exports, "getConfig", { enumerable: true, get: function () { return index_js_2.getConfig; } });
|
|
55
|
+
Object.defineProperty(exports, "isCI", { enumerable: true, get: function () { return index_js_2.isCI; } });
|
|
56
|
+
Object.defineProperty(exports, "isDebug", { enumerable: true, get: function () { return index_js_2.isDebug; } });
|
|
57
|
+
Object.defineProperty(exports, "getBrowserLaunchOptions", { enumerable: true, get: function () { return index_js_2.getBrowserLaunchOptions; } });
|
|
58
|
+
Object.defineProperty(exports, "setTestEnv", { enumerable: true, get: function () { return index_js_2.setTestEnv; } });
|
|
59
|
+
// Allure
|
|
60
|
+
Object.defineProperty(exports, "severity", { enumerable: true, get: function () { return index_js_2.severity; } });
|
|
61
|
+
Object.defineProperty(exports, "tag", { enumerable: true, get: function () { return index_js_2.tag; } });
|
|
62
|
+
Object.defineProperty(exports, "epic", { enumerable: true, get: function () { return index_js_2.epic; } });
|
|
63
|
+
Object.defineProperty(exports, "feature", { enumerable: true, get: function () { return index_js_2.feature; } });
|
|
64
|
+
Object.defineProperty(exports, "story", { enumerable: true, get: function () { return index_js_2.story; } });
|
|
65
|
+
Object.defineProperty(exports, "owner", { enumerable: true, get: function () { return index_js_2.owner; } });
|
|
66
|
+
Object.defineProperty(exports, "description", { enumerable: true, get: function () { return index_js_2.description; } });
|
|
67
|
+
Object.defineProperty(exports, "descriptionHtml", { enumerable: true, get: function () { return index_js_2.descriptionHtml; } });
|
|
68
|
+
Object.defineProperty(exports, "link", { enumerable: true, get: function () { return index_js_2.link; } });
|
|
69
|
+
Object.defineProperty(exports, "issue", { enumerable: true, get: function () { return index_js_2.issue; } });
|
|
70
|
+
Object.defineProperty(exports, "tms", { enumerable: true, get: function () { return index_js_2.tms; } });
|
|
71
|
+
Object.defineProperty(exports, "allure", { enumerable: true, get: function () { return index_js_2.allure; } });
|
|
72
|
+
Object.defineProperty(exports, "allureMeta", { enumerable: true, get: function () { return index_js_2.allureMeta; } });
|
|
73
|
+
Object.defineProperty(exports, "addLabel", { enumerable: true, get: function () { return index_js_2.addLabel; } });
|
|
74
|
+
Object.defineProperty(exports, "addLink", { enumerable: true, get: function () { return index_js_2.addLink; } });
|
|
75
|
+
Object.defineProperty(exports, "addAttachment", { enumerable: true, get: function () { return index_js_2.addAttachment; } });
|
|
76
|
+
Object.defineProperty(exports, "attachScreenshot", { enumerable: true, get: function () { return index_js_2.attachScreenshot; } });
|
|
77
|
+
Object.defineProperty(exports, "attachJson", { enumerable: true, get: function () { return index_js_2.attachJson; } });
|
|
78
|
+
Object.defineProperty(exports, "attachText", { enumerable: true, get: function () { return index_js_2.attachText; } });
|
|
79
|
+
Object.defineProperty(exports, "attachHtml", { enumerable: true, get: function () { return index_js_2.attachHtml; } });
|
|
80
|
+
Object.defineProperty(exports, "allureStep", { enumerable: true, get: function () { return index_js_2.allureStep; } });
|
|
81
|
+
Object.defineProperty(exports, "getAllureMetadata", { enumerable: true, get: function () { return index_js_2.getAllureMetadata; } });
|
|
82
|
+
Object.defineProperty(exports, "getAllureMetadataKeys", { enumerable: true, get: function () { return index_js_2.getAllureMetadataKeys; } });
|
|
83
|
+
/**
|
|
84
|
+
* Version of SamaroUItest
|
|
85
|
+
*/
|
|
86
|
+
exports.VERSION = '1.0.2';
|
|
87
|
+
/**
|
|
88
|
+
* Check if the package is properly installed
|
|
89
|
+
*/
|
|
90
|
+
function checkInstallation() {
|
|
91
|
+
try {
|
|
92
|
+
// Try to import required dependencies
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
|
+
catch {
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;AAsHH,8CAOC;AA3HD,gDAAgD;AAChD,4BAA0B;AAE1B,wBAAwB;AACxB,+CAQ4B;AAP1B,8GAAA,kBAAkB,OAAA;AAClB,kHAAA,sBAAsB,OAAA;AACtB,iHAAA,qBAAqB,OAAA;AACrB,uGAAA,WAAW,OAAA;AAMb,iBAAiB;AACjB,gDA2F6B;AA1F3B,QAAQ;AACR,iHAAA,qBAAqB,OAAA;AACrB,iHAAA,qBAAqB,OAAA;AACrB,oGAAA,QAAQ,OAAA;AACR,wGAAA,YAAY,OAAA;AACZ,0GAAA,cAAc,OA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AAA;AACV,sGAAA,UAAU,OAAA;AACV,sGAAA,UAAU,OAAA;AACV,sGAAA,UAAU,OAAA;AACV,6GAAA,iBAAiB,OAAA;AACjB,iHAAA,qBAAqB,OAAA;AAgBvB;;GAEG;AACU,QAAA,OAAO,GAAG,OAAO,CAAC;AAE/B;;GAEG;AACH,SAAgB,iBAAiB;IAC/B,IAAI,CAAC;QACH,sCAAsC;QACtC,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { createVitestConfig, mergeConfig, type SamaroVitestOptions } from './vitest.config.js';
|
|
2
|
+
export { createPlaywrightConfig, type SamaroPlaywrightOptions } from './playwright.config.js';
|
|
3
|
+
export { createComponentConfig, type SamaroComponentOptions } from './playwright.component.config.js';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,KAAK,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC/F,OAAO,EAAE,sBAAsB,EAAE,KAAK,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAC9F,OAAO,EAAE,qBAAqB,EAAE,KAAK,sBAAsB,EAAE,MAAM,kCAAkC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file": "index.mjs","sourceRoot":"","sources":["../../../config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAA4B,MAAM,oBAAoB,CAAC;AAC/F,OAAO,EAAE,sBAAsB,EAAgC,MAAM,wBAAwB,CAAC;AAC9F,OAAO,EAAE,qBAAqB,EAA+B,MAAM,kCAAkC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PlaywrightTestConfig } from '@playwright/test';
|
|
2
|
+
export interface SamaroComponentOptions {
|
|
3
|
+
baseURL?: string;
|
|
4
|
+
testDir?: string;
|
|
5
|
+
resultsDir?: string;
|
|
6
|
+
webServerCommand?: string;
|
|
7
|
+
webServerPort?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function createComponentConfig(options?: SamaroComponentOptions): PlaywrightTestConfig;
|
|
10
|
+
declare const _default: PlaywrightTestConfig;
|
|
11
|
+
export default _default;
|
|
12
|
+
//# sourceMappingURL=playwright.component.config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playwright.component.config.d.ts","sourceRoot":"","sources":["../../../config/playwright.component.config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAE7D,MAAM,WAAW,sBAAsB;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,wBAAgB,qBAAqB,CAAC,OAAO,GAAE,sBAA2B,GAAG,oBAAoB,CA8ChG;;AAED,wBAAuC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { defineConfig, devices } from '@playwright/test';
|
|
2
|
+
export function createComponentConfig(options = {}) {
|
|
3
|
+
const { baseURL = 'http://localhost:4200', testDir = './ct-tests', resultsDir = 'allure-ct-results', webServerCommand = 'npm run start', webServerPort = 4200, } = options;
|
|
4
|
+
return defineConfig({
|
|
5
|
+
testDir,
|
|
6
|
+
fullyParallel: true,
|
|
7
|
+
forbidOnly: !!process.env.CI,
|
|
8
|
+
retries: process.env.CI ? 2 : 0,
|
|
9
|
+
workers: process.env.CI ? 1 : undefined,
|
|
10
|
+
reporter: [
|
|
11
|
+
['allure-playwright', {
|
|
12
|
+
resultsDir,
|
|
13
|
+
detail: true,
|
|
14
|
+
suiteTitle: true,
|
|
15
|
+
}],
|
|
16
|
+
['html', { outputFolder: 'playwright-component-report' }],
|
|
17
|
+
['list'],
|
|
18
|
+
],
|
|
19
|
+
use: {
|
|
20
|
+
baseURL,
|
|
21
|
+
trace: 'on-first-retry',
|
|
22
|
+
screenshot: 'only-on-failure',
|
|
23
|
+
},
|
|
24
|
+
projects: [
|
|
25
|
+
{
|
|
26
|
+
name: 'chromium',
|
|
27
|
+
use: { ...devices['Desktop Chrome'] },
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
webServer: {
|
|
31
|
+
command: webServerCommand,
|
|
32
|
+
url: `http://localhost:${webServerPort}`,
|
|
33
|
+
reuseExistingServer: !process.env.CI,
|
|
34
|
+
timeout: 120_000,
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
export default createComponentConfig();
|
|
39
|
+
// # sourceMappingURL=playwright.component.config.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file": "playwright.component.config.mjs","sourceRoot":"","sources":["../../../config/playwright.component.config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAWzD,MAAM,UAAU,qBAAqB,CAAC,UAAkC,EAAE;IACxE,MAAM,EACJ,OAAO,GAAG,uBAAuB,EACjC,OAAO,GAAG,YAAY,EACtB,UAAU,GAAG,mBAAmB,EAChC,gBAAgB,GAAG,eAAe,EAClC,aAAa,GAAG,IAAI,GACrB,GAAG,OAAO,CAAC;IAEZ,OAAO,YAAY,CAAC;QAClB,OAAO;QACP,aAAa,EAAE,IAAI;QACnB,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QAC5B,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/B,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;QAEvC,QAAQ,EAAE;YACR,CAAC,mBAAmB,EAAE;oBACpB,UAAU;oBACV,MAAM,EAAE,IAAI;oBACZ,UAAU,EAAE,IAAI;iBACjB,CAAC;YACF,CAAC,MAAM,EAAE,EAAE,YAAY,EAAE,6BAA6B,EAAE,CAAC;YACzD,CAAC,MAAM,CAAC;SACT;QAED,GAAG,EAAE;YACH,OAAO;YACP,KAAK,EAAE,gBAAgB;YACvB,UAAU,EAAE,iBAAiB;SAC9B;QAED,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,UAAU;gBAChB,GAAG,EAAE,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,EAAE;aACtC;SACF;QAED,SAAS,EAAE;YACT,OAAO,EAAE,gBAAgB;YACzB,GAAG,EAAE,oBAAoB,aAAa,EAAE;YACxC,mBAAmB,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YACpC,OAAO,EAAE,OAAO;SACjB;KACF,CAAC,CAAC;AACL,CAAC;AAED,eAAe,qBAAqB,EAAE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { PlaywrightTestConfig } from '@playwright/test';
|
|
2
|
+
export interface SamaroPlaywrightOptions {
|
|
3
|
+
baseURL?: string;
|
|
4
|
+
testDir?: string;
|
|
5
|
+
resultsDir?: string;
|
|
6
|
+
webServerCommand?: string;
|
|
7
|
+
webServerPort?: number;
|
|
8
|
+
webServerTimeout?: number;
|
|
9
|
+
timeout?: number;
|
|
10
|
+
}
|
|
11
|
+
export declare function createPlaywrightConfig(options?: SamaroPlaywrightOptions): PlaywrightTestConfig;
|
|
12
|
+
declare const _default: PlaywrightTestConfig<{}, {}>;
|
|
13
|
+
export default _default;
|
|
14
|
+
//# sourceMappingURL=playwright.config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playwright.config.d.ts","sourceRoot":"","sources":["../../../config/playwright.config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAE7D,MAAM,WAAW,uBAAuB;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,sBAAsB,CAAC,OAAO,GAAE,uBAA4B,GAAG,oBAAoB,CA4DlG;;AAED,wBAAsD"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { defineConfig, devices } from '@playwright/test';
|
|
2
|
+
export function createPlaywrightConfig(options = {}) {
|
|
3
|
+
const { baseURL = 'http://localhost:4200', testDir = './e2e', resultsDir = 'allure-e2e-results', webServerCommand = 'npm run start', webServerPort = 4200, webServerTimeout = 120_000, timeout = 15_000, } = options;
|
|
4
|
+
return {
|
|
5
|
+
testDir,
|
|
6
|
+
fullyParallel: false,
|
|
7
|
+
forbidOnly: !!process.env.CI,
|
|
8
|
+
retries: process.env.CI ? 2 : 1,
|
|
9
|
+
workers: 1,
|
|
10
|
+
timeout,
|
|
11
|
+
reporter: [
|
|
12
|
+
['allure-playwright', {
|
|
13
|
+
resultsDir,
|
|
14
|
+
detail: true,
|
|
15
|
+
suiteTitle: true,
|
|
16
|
+
environmentInfo: {
|
|
17
|
+
framework: 'playwright',
|
|
18
|
+
os_platform: process.platform,
|
|
19
|
+
node_version: process.version,
|
|
20
|
+
},
|
|
21
|
+
}],
|
|
22
|
+
['html', { outputFolder: 'playwright-report' }],
|
|
23
|
+
['list'],
|
|
24
|
+
],
|
|
25
|
+
use: {
|
|
26
|
+
baseURL,
|
|
27
|
+
trace: 'on-first-retry',
|
|
28
|
+
screenshot: 'only-on-failure',
|
|
29
|
+
actionTimeout: 5_000,
|
|
30
|
+
navigationTimeout: 10_000,
|
|
31
|
+
},
|
|
32
|
+
expect: {
|
|
33
|
+
timeout: 5_000,
|
|
34
|
+
},
|
|
35
|
+
projects: [
|
|
36
|
+
{
|
|
37
|
+
name: 'chromium',
|
|
38
|
+
use: { ...devices['Desktop Chrome'] },
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
webServer: {
|
|
42
|
+
command: webServerCommand,
|
|
43
|
+
url: `http://localhost:${webServerPort}`,
|
|
44
|
+
reuseExistingServer: !process.env.CI,
|
|
45
|
+
timeout: webServerTimeout,
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export default defineConfig(createPlaywrightConfig());
|
|
50
|
+
// # sourceMappingURL=playwright.config.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file": "playwright.config.mjs","sourceRoot":"","sources":["../../../config/playwright.config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAazD,MAAM,UAAU,sBAAsB,CAAC,UAAmC,EAAE;IAC1E,MAAM,EACJ,OAAO,GAAG,uBAAuB,EACjC,OAAO,GAAG,OAAO,EACjB,UAAU,GAAG,oBAAoB,EACjC,gBAAgB,GAAG,eAAe,EAClC,aAAa,GAAG,IAAI,EACpB,gBAAgB,GAAG,OAAO,EAC1B,OAAO,GAAG,MAAM,GACjB,GAAG,OAAO,CAAC;IAEZ,OAAO;QACL,OAAO;QACP,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QAC5B,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/B,OAAO,EAAE,CAAC;QACV,OAAO;QAEP,QAAQ,EAAE;YACR,CAAC,mBAAmB,EAAE;oBACpB,UAAU;oBACV,MAAM,EAAE,IAAI;oBACZ,UAAU,EAAE,IAAI;oBAChB,eAAe,EAAE;wBACf,SAAS,EAAE,YAAY;wBACvB,WAAW,EAAE,OAAO,CAAC,QAAQ;wBAC7B,YAAY,EAAE,OAAO,CAAC,OAAO;qBAC9B;iBACF,CAAC;YACF,CAAC,MAAM,EAAE,EAAE,YAAY,EAAE,mBAAmB,EAAE,CAAC;YAC/C,CAAC,MAAM,CAAC;SACT;QAED,GAAG,EAAE;YACH,OAAO;YACP,KAAK,EAAE,gBAAgB;YACvB,UAAU,EAAE,iBAAiB;YAC7B,aAAa,EAAE,KAAK;YACpB,iBAAiB,EAAE,MAAM;SAC1B;QAED,MAAM,EAAE;YACN,OAAO,EAAE,KAAK;SACf;QAED,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,UAAU;gBAChB,GAAG,EAAE,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,EAAE;aACtC;SACF;QAED,SAAS,EAAE;YACT,OAAO,EAAE,gBAAgB;YACzB,GAAG,EAAE,oBAAoB,aAAa,EAAE;YACxC,mBAAmB,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YACpC,OAAO,EAAE,gBAAgB;SAC1B;KACF,CAAC;AACJ,CAAC;AAED,eAAe,YAAY,CAAC,sBAAsB,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { mergeConfig } from 'vitest/config';
|
|
2
|
+
export interface SamaroVitestOptions {
|
|
3
|
+
projectRoot?: string;
|
|
4
|
+
testGlob?: string | string[];
|
|
5
|
+
resultsDir?: string;
|
|
6
|
+
setupFiles?: string[];
|
|
7
|
+
alias?: Record<string, string>;
|
|
8
|
+
}
|
|
9
|
+
export declare function createVitestConfig(options?: SamaroVitestOptions): import("vite").UserConfig;
|
|
10
|
+
export { mergeConfig };
|
|
11
|
+
export default createVitestConfig;
|
|
12
|
+
//# sourceMappingURL=vitest.config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vitest.config.d.ts","sourceRoot":"","sources":["../../../config/vitest.config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,WAAW,EAAE,MAAM,eAAe,CAAC;AAqB1D,MAAM,WAAW,mBAAmB;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC;AAED,wBAAgB,kBAAkB,CAAC,OAAO,GAAE,mBAAwB,6BA+CnE;AAED,OAAO,EAAE,WAAW,EAAE,CAAC;AACvB,eAAe,kBAAkB,CAAC"}
|