dceky 1.0.0-beta.6 → 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/.eslintrc.js +93 -0
- package/README.md +41 -0
- package/cypress/e2e/profile-test.cy.ts +10 -0
- package/cypress/fixtures/example.json +5 -0
- package/cypress/support/commands.ts +37 -0
- package/cypress/support/e2e.ts +17 -0
- package/cypress.config.ts +9 -0
- package/docs/GlobalsAndProfiles.md +23 -0
- package/lib/setup/addToGitIgnore.d.ts +6 -0
- package/lib/setup/addToGitIgnore.js +47 -0
- package/lib/setup/addToGitIgnore.js.map +1 -0
- package/lib/setup/checkRequiredFiles.d.ts +6 -0
- package/lib/setup/checkRequiredFiles.js +59 -0
- package/lib/setup/checkRequiredFiles.js.map +1 -0
- package/lib/setup/genCommandImportFile.d.ts +7 -0
- package/lib/setup/genCommandImportFile.js +67 -0
- package/lib/setup/genCommandImportFile.js.map +1 -0
- package/lib/setup/genDynamicConfigFile.d.ts +5 -0
- package/lib/setup/genDynamicConfigFile.js +29 -0
- package/lib/setup/genDynamicConfigFile.js.map +1 -0
- package/lib/setup/helpers/getRootPath.d.ts +7 -0
- package/lib/setup/helpers/getRootPath.js +17 -0
- package/lib/setup/helpers/getRootPath.js.map +1 -0
- package/lib/setup/index.d.ts +1 -0
- package/lib/setup/index.js +16 -0
- package/lib/setup/index.js.map +1 -0
- package/lib/setup/setupCypressDependencies.d.ts +6 -0
- package/lib/setup/setupCypressDependencies.js +40 -0
- package/lib/setup/setupCypressDependencies.js.map +1 -0
- package/lib/src/commands/assertDoesNotHaveClass.d.ts +20 -0
- package/lib/src/commands/assertDoesNotHaveClass.js +17 -0
- package/lib/src/commands/assertDoesNotHaveClass.js.map +1 -0
- package/lib/src/commands/assertHasClass.d.ts +20 -0
- package/lib/src/commands/assertHasClass.js +17 -0
- package/lib/src/commands/assertHasClass.js.map +1 -0
- package/lib/src/commands/assertNumElements.d.ts +19 -0
- package/lib/src/commands/assertNumElements.js +17 -0
- package/lib/src/commands/assertNumElements.js.map +1 -0
- package/lib/src/commands/extractDataFromClass.d.ts +18 -0
- package/lib/src/commands/extractDataFromClass.js +25 -0
- package/lib/src/commands/extractDataFromClass.js.map +1 -0
- package/lib/src/commands/extractDataFromClassByContents.d.ts +19 -0
- package/lib/src/commands/extractDataFromClassByContents.js +26 -0
- package/lib/src/commands/extractDataFromClassByContents.js.map +1 -0
- package/lib/src/commands/getJSON.d.ts +16 -0
- package/lib/src/commands/getJSON.js +21 -0
- package/lib/src/commands/getJSON.js.map +1 -0
- package/lib/src/commands/getNumElements.d.ts +15 -0
- package/lib/src/commands/getNumElements.js +19 -0
- package/lib/src/commands/getNumElements.js.map +1 -0
- package/lib/src/commands/handleHarvardKey.d.ts +15 -0
- package/lib/src/commands/handleHarvardKey.js +53 -0
- package/lib/src/commands/handleHarvardKey.js.map +1 -0
- package/lib/src/commands/launchAs.d.ts +25 -0
- package/lib/src/commands/launchAs.js +66 -0
- package/lib/src/commands/launchAs.js.map +1 -0
- package/lib/src/commands/launchLTIUsingToken.d.ts +21 -0
- package/lib/src/commands/launchLTIUsingToken.js +68 -0
- package/lib/src/commands/launchLTIUsingToken.js.map +1 -0
- package/lib/src/commands/navigateToHref.d.ts +15 -0
- package/lib/src/commands/navigateToHref.js +35 -0
- package/lib/src/commands/navigateToHref.js.map +1 -0
- package/lib/src/commands/runScript.d.ts +15 -0
- package/lib/src/commands/runScript.js +20 -0
- package/lib/src/commands/runScript.js.map +1 -0
- package/lib/src/commands/typeInto.d.ts +24 -0
- package/lib/src/commands/typeInto.js +41 -0
- package/lib/src/commands/typeInto.js.map +1 -0
- package/lib/src/commands/visitCanvasGETEndpoint.d.ts +20 -0
- package/lib/src/commands/visitCanvasGETEndpoint.js +26 -0
- package/lib/src/commands/visitCanvasGETEndpoint.js.map +1 -0
- package/lib/src/commands/waitForElementVisible.d.ts +16 -0
- package/lib/src/commands/waitForElementVisible.js +19 -0
- package/lib/src/commands/waitForElementVisible.js.map +1 -0
- package/lib/src/genConfiguration/helpers/getRootPath.d.ts +7 -0
- package/lib/src/genConfiguration/helpers/getRootPath.js +17 -0
- package/lib/src/genConfiguration/helpers/getRootPath.js.map +1 -0
- package/lib/src/genConfiguration/helpers/resolveDependents.d.ts +13 -0
- package/lib/src/genConfiguration/helpers/resolveDependents.js +50 -0
- package/lib/src/genConfiguration/helpers/resolveDependents.js.map +1 -0
- package/lib/src/genConfiguration/helpers/splitEnv.d.ts +10 -0
- package/lib/src/genConfiguration/helpers/splitEnv.js +27 -0
- package/lib/src/genConfiguration/helpers/splitEnv.js.map +1 -0
- package/{src/genConfiguration.ts → lib/src/genConfiguration/index.d.ts} +3 -6
- package/lib/src/genConfiguration/index.js +89 -0
- package/lib/src/genConfiguration/index.js.map +1 -0
- package/lib/src/genConfiguration/types/DependentValue.d.ts +11 -0
- package/lib/src/genConfiguration/types/DependentValue.js +3 -0
- package/lib/src/genConfiguration/types/DependentValue.js.map +1 -0
- package/lib/src/genConfiguration/types/GlobalsOrProfile.d.ts +9 -0
- package/lib/src/genConfiguration/types/GlobalsOrProfile.js +3 -0
- package/lib/src/genConfiguration/types/GlobalsOrProfile.js.map +1 -0
- package/lib/src/genConfiguration/types/SplitEnv.d.ts +13 -0
- package/lib/src/genConfiguration/types/SplitEnv.js +3 -0
- package/lib/src/genConfiguration/types/SplitEnv.js.map +1 -0
- package/lib/{index.d.ts → src/index.d.ts} +1 -1
- package/lib/{index.js → src/index.js} +6 -3
- package/lib/src/index.js.map +1 -0
- package/lib/src/init.d.ts +6 -0
- package/lib/src/init.js +45 -0
- package/lib/src/init.js.map +1 -0
- package/lib/start/constants/AVAILABLE_BROWSERS.d.ts +9 -0
- package/lib/start/constants/AVAILABLE_BROWSERS.js +27 -0
- package/lib/start/constants/AVAILABLE_BROWSERS.js.map +1 -0
- package/lib/start/helpers/exec.d.ts +8 -0
- package/lib/start/helpers/exec.js +18 -0
- package/lib/start/helpers/exec.js.map +1 -0
- package/lib/start/helpers/extractArgValue.d.ts +10 -0
- package/lib/start/helpers/extractArgValue.js +39 -0
- package/lib/start/helpers/extractArgValue.js.map +1 -0
- package/lib/start/helpers/findProfilesByNames.d.ts +16 -0
- package/lib/start/helpers/findProfilesByNames.js +35 -0
- package/lib/start/helpers/findProfilesByNames.js.map +1 -0
- package/lib/start/helpers/getRootPath.d.ts +7 -0
- package/lib/start/helpers/getRootPath.js +17 -0
- package/lib/start/helpers/getRootPath.js.map +1 -0
- package/lib/start/helpers/parseCommaSeparated.d.ts +8 -0
- package/lib/start/helpers/parseCommaSeparated.js +23 -0
- package/lib/start/helpers/parseCommaSeparated.js.map +1 -0
- package/lib/start/helpers/print.d.ts +38 -0
- package/lib/start/helpers/print.js +145 -0
- package/lib/start/helpers/print.js.map +1 -0
- package/lib/start/helpers/prompt.d.ts +8 -0
- package/lib/start/helpers/prompt.js +25 -0
- package/lib/start/helpers/prompt.js.map +1 -0
- package/lib/start/helpers/showChooser.d.ts +21 -0
- package/lib/start/helpers/showChooser.js +116 -0
- package/lib/start/helpers/showChooser.js.map +1 -0
- package/lib/start/helpers/validateBrowsers.d.ts +8 -0
- package/lib/start/helpers/validateBrowsers.js +36 -0
- package/lib/start/helpers/validateBrowsers.js.map +1 -0
- package/lib/start/index.d.ts +7 -0
- package/lib/start/index.js +140 -0
- package/lib/start/index.js.map +1 -0
- package/lib/start/types/ChooserOption.d.ts +10 -0
- package/lib/start/types/ChooserOption.js +3 -0
- package/lib/start/types/ChooserOption.js.map +1 -0
- package/package.json +28 -8
- package/setup/addToGitIgnore.ts +48 -0
- package/setup/checkRequiredFiles.ts +63 -0
- package/setup/genCommandImportFile.ts +76 -0
- package/setup/genDynamicConfigFile.ts +29 -0
- package/setup/helpers/getRootPath.ts +13 -0
- package/setup/index.ts +11 -0
- package/setup/setupCypressDependencies.ts +38 -0
- package/src/commands/assertDoesNotHaveClass.ts +51 -0
- package/src/commands/assertHasClass.ts +51 -0
- package/src/commands/assertNumElements.ts +50 -0
- package/src/commands/extractDataFromClass.ts +52 -0
- package/src/commands/extractDataFromClassByContents.ts +55 -0
- package/src/commands/getJSON.ts +45 -0
- package/src/commands/getNumElements.ts +45 -0
- package/src/commands/handleHarvardKey.ts +91 -0
- package/src/commands/launchAs.ts +120 -0
- package/src/commands/launchLTIUsingToken.ts +115 -0
- package/src/commands/navigateToHref.ts +60 -0
- package/src/commands/runScript.ts +44 -0
- package/src/commands/typeInto.ts +88 -0
- package/src/commands/visitCanvasGETEndpoint.ts +61 -0
- package/src/commands/waitForElementVisible.ts +49 -0
- package/src/genConfiguration/helpers/getRootPath.ts +13 -0
- package/src/genConfiguration/helpers/resolveDependents.ts +46 -0
- package/src/genConfiguration/helpers/splitEnv.ts +30 -0
- package/src/genConfiguration/index.ts +95 -0
- package/src/genConfiguration/types/DependentValue.ts +14 -0
- package/src/genConfiguration/types/GlobalsOrProfile.ts +12 -0
- package/src/genConfiguration/types/SplitEnv.ts +18 -0
- package/src/index.ts +7 -4
- package/src/init.ts +36 -17
- package/start/constants/AVAILABLE_BROWSERS.ts +28 -0
- package/start/helpers/exec.ts +17 -0
- package/start/helpers/extractArgValue.ts +42 -0
- package/start/helpers/findProfilesByNames.ts +39 -0
- package/start/helpers/getRootPath.ts +13 -0
- package/start/helpers/parseCommaSeparated.ts +23 -0
- package/start/helpers/print.ts +155 -0
- package/start/helpers/prompt.ts +23 -0
- package/start/helpers/showChooser.ts +140 -0
- package/start/helpers/validateBrowsers.ts +35 -0
- package/start/index.ts +164 -0
- package/start/types/ChooserOption.ts +11 -0
- package/tsconfig.json +3 -4
- package/.eslintrc.json +0 -58
- package/lib/genConfiguration.d.ts +0 -8
- package/lib/genConfiguration.js +0 -13
- package/lib/genConfiguration.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/init.d.ts +0 -13
- package/lib/init.js +0 -10
- package/lib/init.js.map +0 -1
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
const config = {
|
|
2
|
+
extends: [
|
|
3
|
+
'airbnb',
|
|
4
|
+
'airbnb/hooks',
|
|
5
|
+
],
|
|
6
|
+
overrides: [
|
|
7
|
+
{
|
|
8
|
+
files: [
|
|
9
|
+
'*.ts',
|
|
10
|
+
'*.tsx',
|
|
11
|
+
],
|
|
12
|
+
extends: [
|
|
13
|
+
'airbnb-typescript',
|
|
14
|
+
],
|
|
15
|
+
parserOptions: {
|
|
16
|
+
project: './tsconfig.json',
|
|
17
|
+
tsconfigRootDir: __dirname,
|
|
18
|
+
sourceType: 'module',
|
|
19
|
+
},
|
|
20
|
+
rules: {
|
|
21
|
+
'@typescript-eslint/lines-between-class-members': 'off',
|
|
22
|
+
'@typescript-eslint/no-unused-expressions': 'off',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
rules: {
|
|
27
|
+
'arrow-body-style': [
|
|
28
|
+
'warn',
|
|
29
|
+
'always',
|
|
30
|
+
],
|
|
31
|
+
'react/prop-types': 'off',
|
|
32
|
+
'react/function-component-definition': [
|
|
33
|
+
2,
|
|
34
|
+
{
|
|
35
|
+
namedComponents: 'arrow-function',
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
'no-spaced-func': 'off',
|
|
39
|
+
'react-hooks/exhaustive-deps': 'off',
|
|
40
|
+
'lines-between-class-members': 'off',
|
|
41
|
+
'no-case-declarations': 'off',
|
|
42
|
+
'react/require-default-props': 'off',
|
|
43
|
+
'react/react-in-jsx-scope': 'off',
|
|
44
|
+
'arrow-parens': [
|
|
45
|
+
'warn',
|
|
46
|
+
'always',
|
|
47
|
+
],
|
|
48
|
+
'comma-dangle': [
|
|
49
|
+
'error',
|
|
50
|
+
{
|
|
51
|
+
arrays: 'always-multiline',
|
|
52
|
+
objects: 'always-multiline',
|
|
53
|
+
imports: 'always-multiline',
|
|
54
|
+
exports: 'always-multiline',
|
|
55
|
+
functions: 'always-multiline',
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
'consistent-return': 'off',
|
|
59
|
+
'id-length': 'off',
|
|
60
|
+
'max-len': [
|
|
61
|
+
'error',
|
|
62
|
+
{
|
|
63
|
+
code: 125,
|
|
64
|
+
ignoreStrings: true,
|
|
65
|
+
ignoreTemplateLiterals: true,
|
|
66
|
+
ignoreUrls: true,
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
'newline-per-chained-call': [
|
|
70
|
+
'error',
|
|
71
|
+
{
|
|
72
|
+
ignoreChainWithDepth: 2,
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
'no-plusplus': [
|
|
76
|
+
'warn',
|
|
77
|
+
{
|
|
78
|
+
allowForLoopAfterthoughts: true,
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
'prefer-template': 1,
|
|
82
|
+
radix: 'error',
|
|
83
|
+
'no-await-in-loop': 'off',
|
|
84
|
+
'max-params': [
|
|
85
|
+
'warn',
|
|
86
|
+
{
|
|
87
|
+
max: 3,
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
module.exports = config;
|
package/README.md
CHANGED
|
@@ -1,3 +1,44 @@
|
|
|
1
1
|
# dceky
|
|
2
2
|
|
|
3
3
|
Cypress toolkit for Harvard DCE
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
To use this library in your project, add the following scripts to your `package.json`:
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
{
|
|
11
|
+
"scripts": {
|
|
12
|
+
"ky:setup": "npm explore dceky -- npm run ky:setup",
|
|
13
|
+
"ky:start": "npm explore dceky -- npm run ky:start",
|
|
14
|
+
"ky:dev": "npm explore dceky -- npm run ky:dev"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Commands
|
|
20
|
+
|
|
21
|
+
### `ky:setup`
|
|
22
|
+
|
|
23
|
+
**What it does:** Generates the necessary configuration files for your Cypress project:
|
|
24
|
+
- Creates `cypress.config.ts` that automatically merges your global credentials, resources, values, and profiles
|
|
25
|
+
- Generates `cypress/commands/index.ts` that auto-imports all custom commands from your `cypress/commands` directory
|
|
26
|
+
|
|
27
|
+
**When to use:**
|
|
28
|
+
- When you first set up the project
|
|
29
|
+
- After adding new custom commands to `cypress/commands`
|
|
30
|
+
- After modifying global configuration files in `cypress/globals` or profile files in `cypress/profiles`
|
|
31
|
+
|
|
32
|
+
### `ky:start`
|
|
33
|
+
|
|
34
|
+
**What it does:** Interactive wizard for running Cypress tests.
|
|
35
|
+
|
|
36
|
+
**When to use:**
|
|
37
|
+
- If you want to run cypress tests without regenerating setup files.
|
|
38
|
+
|
|
39
|
+
### `ky:dev`
|
|
40
|
+
|
|
41
|
+
**What it does:** Runs both `setup` and `start`.
|
|
42
|
+
|
|
43
|
+
**When to use:**
|
|
44
|
+
- If you want to generate setup files and run cypress tests.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/// <reference types="cypress" />
|
|
2
|
+
// ***********************************************
|
|
3
|
+
// This example commands.ts shows you how to
|
|
4
|
+
// create various custom commands and overwrite
|
|
5
|
+
// existing commands.
|
|
6
|
+
//
|
|
7
|
+
// For more comprehensive examples of custom
|
|
8
|
+
// commands please read more here:
|
|
9
|
+
// https://on.cypress.io/custom-commands
|
|
10
|
+
// ***********************************************
|
|
11
|
+
//
|
|
12
|
+
//
|
|
13
|
+
// -- This is a parent command --
|
|
14
|
+
// Cypress.Commands.add('login', (email, password) => { ... })
|
|
15
|
+
//
|
|
16
|
+
//
|
|
17
|
+
// -- This is a child command --
|
|
18
|
+
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
|
|
19
|
+
//
|
|
20
|
+
//
|
|
21
|
+
// -- This is a dual command --
|
|
22
|
+
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
|
|
23
|
+
//
|
|
24
|
+
//
|
|
25
|
+
// -- This will overwrite an existing command --
|
|
26
|
+
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
|
|
27
|
+
//
|
|
28
|
+
// declare global {
|
|
29
|
+
// namespace Cypress {
|
|
30
|
+
// interface Chainable {
|
|
31
|
+
// login(email: string, password: string): Chainable<void>
|
|
32
|
+
// drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
|
|
33
|
+
// dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
|
|
34
|
+
// visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
|
|
35
|
+
// }
|
|
36
|
+
// }
|
|
37
|
+
// }
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// ***********************************************************
|
|
2
|
+
// This example support/e2e.ts is processed and
|
|
3
|
+
// loaded automatically before your test files.
|
|
4
|
+
//
|
|
5
|
+
// This is a great place to put global configuration and
|
|
6
|
+
// behavior that modifies Cypress.
|
|
7
|
+
//
|
|
8
|
+
// You can change the location of this file or turn off
|
|
9
|
+
// automatically serving support files with the
|
|
10
|
+
// 'supportFile' configuration option.
|
|
11
|
+
//
|
|
12
|
+
// You can read more here:
|
|
13
|
+
// https://on.cypress.io/configuration
|
|
14
|
+
// ***********************************************************
|
|
15
|
+
|
|
16
|
+
// Import commands.js using ES2015 syntax:
|
|
17
|
+
import './commands'
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Globals and Profiles Configuration
|
|
2
|
+
|
|
3
|
+
### Configuration Setup
|
|
4
|
+
|
|
5
|
+
The configuration setup involves the following steps:
|
|
6
|
+
|
|
7
|
+
1. Split each globals/profiles map into two: `basic` values and `dependsOn` values.
|
|
8
|
+
2. Merge all `basic` values into a running env object (in order so last ones processed are the highest priority).
|
|
9
|
+
3. Go through each `dependsOn` value, look up the value it depends on in the running env object.
|
|
10
|
+
4. Add `dependsOn` values into the running env object (in order so last ones processed are the highest priority).
|
|
11
|
+
5. Wrap the env object into a config.
|
|
12
|
+
|
|
13
|
+
### Assumptions
|
|
14
|
+
|
|
15
|
+
* `dependsOn` values must depend on a basic `value`, not on another `dependsOn` value.
|
|
16
|
+
|
|
17
|
+
### DependsOn Value
|
|
18
|
+
|
|
19
|
+
The `dependsOn` value is an object that has the following structure:
|
|
20
|
+
|
|
21
|
+
* `dependsOn`: the key of the `basic` value that we are depending on
|
|
22
|
+
* `value`: the value that we are depending on (can be a string, number, boolean, etc.)
|
|
23
|
+
* `default`: the default value if the `dependsOn` value is not found
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
/* eslint-disable no-console */
|
|
7
|
+
var fs_1 = require("fs");
|
|
8
|
+
var path_1 = __importDefault(require("path"));
|
|
9
|
+
var getRootPath_1 = __importDefault(require("./helpers/getRootPath"));
|
|
10
|
+
/**
|
|
11
|
+
* Ensure gitignore includes the necessary entries for Cypress results
|
|
12
|
+
* @author Yuen Ler Chow
|
|
13
|
+
*/
|
|
14
|
+
var addToGitIgnore = function () {
|
|
15
|
+
var root = (0, getRootPath_1.default)();
|
|
16
|
+
var gitignorePath = path_1.default.join(root, '.gitignore');
|
|
17
|
+
var entries = [
|
|
18
|
+
'cypress-results/',
|
|
19
|
+
'cypress/downloads',
|
|
20
|
+
'cypress/screenshots',
|
|
21
|
+
'cypress/videos',
|
|
22
|
+
];
|
|
23
|
+
var gitignoreContent = '';
|
|
24
|
+
if ((0, fs_1.existsSync)(gitignorePath)) {
|
|
25
|
+
gitignoreContent = (0, fs_1.readFileSync)(gitignorePath, 'utf8');
|
|
26
|
+
}
|
|
27
|
+
// Check which entries are missing
|
|
28
|
+
var missingEntries = entries.filter(function (entry) {
|
|
29
|
+
// Check if entry exists (with or without newline)
|
|
30
|
+
var regex = new RegExp("^".concat(entry.replace(/\//g, '\\/'), "$"), 'm');
|
|
31
|
+
return !regex.test(gitignoreContent);
|
|
32
|
+
});
|
|
33
|
+
// Add missing entries
|
|
34
|
+
if (missingEntries.length > 0) {
|
|
35
|
+
if (gitignoreContent && !gitignoreContent.endsWith('\n')) {
|
|
36
|
+
gitignoreContent += '\n';
|
|
37
|
+
}
|
|
38
|
+
gitignoreContent += '\n# Cypress parallel test results (added by dceky)\n';
|
|
39
|
+
missingEntries.forEach(function (entry) {
|
|
40
|
+
gitignoreContent += "".concat(entry, "\n");
|
|
41
|
+
});
|
|
42
|
+
(0, fs_1.writeFileSync)(gitignorePath, gitignoreContent, 'utf8');
|
|
43
|
+
console.log("Added ".concat(missingEntries.length, " entries to .gitignore"));
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
exports.default = addToGitIgnore;
|
|
47
|
+
//# sourceMappingURL=addToGitIgnore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addToGitIgnore.js","sourceRoot":"","sources":["../../setup/addToGitIgnore.ts"],"names":[],"mappings":";;;;;AAAA,+BAA+B;AAC/B,yBAA6D;AAC7D,8CAAwB;AACxB,sEAAgD;AAEhD;;;GAGG;AACH,IAAM,cAAc,GAAG;IACrB,IAAM,IAAI,GAAG,IAAA,qBAAW,GAAE,CAAC;IAE3B,IAAM,aAAa,GAAG,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;IAEpD,IAAM,OAAO,GAAG;QACd,kBAAkB;QAClB,mBAAmB;QACnB,qBAAqB;QACrB,gBAAgB;KACjB,CAAC;IAEF,IAAI,gBAAgB,GAAG,EAAE,CAAC;IAC1B,IAAI,IAAA,eAAU,EAAC,aAAa,CAAC,EAAE,CAAC;QAC9B,gBAAgB,GAAG,IAAA,iBAAY,EAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IACzD,CAAC;IAED,kCAAkC;IAClC,IAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,UAAC,KAAK;QAC1C,kDAAkD;QAClD,IAAM,KAAK,GAAG,IAAI,MAAM,CAAC,WAAI,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,MAAG,EAAE,GAAG,CAAC,CAAC;QAClE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;IAEH,sBAAsB;IACtB,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9B,IAAI,gBAAgB,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YACzD,gBAAgB,IAAI,IAAI,CAAC;QAC3B,CAAC;QACD,gBAAgB,IAAI,sDAAsD,CAAC;QAC3E,cAAc,CAAC,OAAO,CAAC,UAAC,KAAK;YAC3B,gBAAgB,IAAI,UAAG,KAAK,OAAI,CAAC;QACnC,CAAC,CAAC,CAAC;QACH,IAAA,kBAAa,EAAC,aAAa,EAAE,gBAAgB,EAAE,MAAM,CAAC,CAAC;QACvD,OAAO,CAAC,GAAG,CAAC,gBAAS,cAAc,CAAC,MAAM,2BAAwB,CAAC,CAAC;IACtE,CAAC;AACH,CAAC,CAAC;AAEF,kBAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
/* eslint-disable no-console */
|
|
7
|
+
var fs_1 = require("fs");
|
|
8
|
+
var path_1 = __importDefault(require("path"));
|
|
9
|
+
var getRootPath_1 = __importDefault(require("./helpers/getRootPath"));
|
|
10
|
+
/**
|
|
11
|
+
* Ensure required configuration files exist in the consumer repo
|
|
12
|
+
* @author Yuen Ler Chow
|
|
13
|
+
*/
|
|
14
|
+
var checkRequiredFiles = function () {
|
|
15
|
+
var root = (0, getRootPath_1.default)();
|
|
16
|
+
var globalsPath = path_1.default.join(root, 'cypress/globals');
|
|
17
|
+
var profilesPath = path_1.default.join(root, 'cypress/profiles');
|
|
18
|
+
// Common file extensions to check
|
|
19
|
+
var extensions = ['.js', '.ts', '.json', '.mjs', '.cjs'];
|
|
20
|
+
// Required global files
|
|
21
|
+
var requiredGlobals = [
|
|
22
|
+
'GlobalCredentials',
|
|
23
|
+
'GlobalResources',
|
|
24
|
+
'GlobalValues',
|
|
25
|
+
];
|
|
26
|
+
// Determine profile file name (default is stage)
|
|
27
|
+
var profileName = process.env.CYPRESS_PROFILE || 'stage';
|
|
28
|
+
var requiredProfile = "".concat(profileName, ".Profile");
|
|
29
|
+
// Check for missing files
|
|
30
|
+
var missingFiles = [];
|
|
31
|
+
// Check global files
|
|
32
|
+
requiredGlobals.forEach(function (file) {
|
|
33
|
+
var filePath = path_1.default.join(globalsPath, file);
|
|
34
|
+
var found = extensions.some(function (ext) {
|
|
35
|
+
return (0, fs_1.existsSync)("".concat(filePath).concat(ext));
|
|
36
|
+
});
|
|
37
|
+
if (!found) {
|
|
38
|
+
missingFiles.push("cypress/globals/".concat(file, ".ts"));
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
// Check profile file
|
|
42
|
+
var profileFilePath = path_1.default.join(profilesPath, requiredProfile);
|
|
43
|
+
var profileFound = extensions.some(function (ext) {
|
|
44
|
+
return (0, fs_1.existsSync)("".concat(profileFilePath).concat(ext));
|
|
45
|
+
});
|
|
46
|
+
if (!profileFound) {
|
|
47
|
+
missingFiles.push("cypress/profiles/".concat(requiredProfile, ".ts"));
|
|
48
|
+
}
|
|
49
|
+
if (missingFiles.length > 0) {
|
|
50
|
+
console.error('\nMissing required configuration files in this project:');
|
|
51
|
+
missingFiles.forEach(function (file) {
|
|
52
|
+
console.error(" - ".concat(file));
|
|
53
|
+
});
|
|
54
|
+
console.error('\nPlease create these files before running setup.');
|
|
55
|
+
process.exit(1);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
exports.default = checkRequiredFiles;
|
|
59
|
+
//# sourceMappingURL=checkRequiredFiles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkRequiredFiles.js","sourceRoot":"","sources":["../../setup/checkRequiredFiles.ts"],"names":[],"mappings":";;;;;AAAA,+BAA+B;AAC/B,yBAAgC;AAChC,8CAAwB;AACxB,sEAAgD;AAEhD;;;GAGG;AACH,IAAM,kBAAkB,GAAG;IACzB,IAAM,IAAI,GAAG,IAAA,qBAAW,GAAE,CAAC;IAE3B,IAAM,WAAW,GAAG,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;IACvD,IAAM,YAAY,GAAG,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;IAEzD,kCAAkC;IAClC,IAAM,UAAU,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAE3D,wBAAwB;IACxB,IAAM,eAAe,GAAG;QACtB,mBAAmB;QACnB,iBAAiB;QACjB,cAAc;KACf,CAAC;IAEF,iDAAiD;IACjD,IAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,OAAO,CAAC;IAC3D,IAAM,eAAe,GAAG,UAAG,WAAW,aAAU,CAAC;IAEjD,0BAA0B;IAC1B,IAAM,YAAY,GAAa,EAAE,CAAC;IAElC,qBAAqB;IACrB,eAAe,CAAC,OAAO,CAAC,UAAC,IAAI;QAC3B,IAAM,QAAQ,GAAG,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;QAC9C,IAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,UAAC,GAAG;YAChC,OAAO,IAAA,eAAU,EAAC,UAAG,QAAQ,SAAG,GAAG,CAAE,CAAC,CAAC;QACzC,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,YAAY,CAAC,IAAI,CAAC,0BAAmB,IAAI,QAAK,CAAC,CAAC;QAClD,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,qBAAqB;IACrB,IAAM,eAAe,GAAG,cAAI,CAAC,IAAI,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC;IACjE,IAAM,YAAY,GAAG,UAAU,CAAC,IAAI,CAAC,UAAC,GAAG;QACvC,OAAO,IAAA,eAAU,EAAC,UAAG,eAAe,SAAG,GAAG,CAAE,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;IACH,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,YAAY,CAAC,IAAI,CAAC,2BAAoB,eAAe,QAAK,CAAC,CAAC;IAC9D,CAAC;IAED,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC5B,OAAO,CAAC,KAAK,CAAC,yDAAyD,CAAC,CAAC;QACzE,YAAY,CAAC,OAAO,CAAC,UAAC,IAAI;YACxB,OAAO,CAAC,KAAK,CAAC,cAAO,IAAI,CAAE,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;QACH,OAAO,CAAC,KAAK,CAAC,mDAAmD,CAAC,CAAC;QACnE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC;AAEF,kBAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var fs_1 = __importDefault(require("fs"));
|
|
7
|
+
var path_1 = __importDefault(require("path"));
|
|
8
|
+
var getRootPath_1 = __importDefault(require("./helpers/getRootPath"));
|
|
9
|
+
/**
|
|
10
|
+
* Generate an index.ts file that imports and runs all command files in cypress/commands
|
|
11
|
+
* This should be called from cypress.config.js
|
|
12
|
+
* @author Yuen Ler Chow
|
|
13
|
+
*/
|
|
14
|
+
var genCommandImportFile = function () {
|
|
15
|
+
var root = (0, getRootPath_1.default)();
|
|
16
|
+
var cypressCommandsDir = path_1.default.join(root, 'cypress/commands');
|
|
17
|
+
var outputFile = path_1.default.join(cypressCommandsDir, 'index.ts');
|
|
18
|
+
var topOfFileComment = '// Auto-generated by dceky - do not edit manually';
|
|
19
|
+
// Check if the directory exists
|
|
20
|
+
if (!fs_1.default.existsSync(cypressCommandsDir)) {
|
|
21
|
+
// Create the directory
|
|
22
|
+
fs_1.default.mkdirSync(cypressCommandsDir, { recursive: true });
|
|
23
|
+
// Create an empty file so init doesn't fail
|
|
24
|
+
fs_1.default.writeFileSync(outputFile, "".concat(topOfFileComment, "\n"));
|
|
25
|
+
return outputFile;
|
|
26
|
+
}
|
|
27
|
+
// Get all files in the directory
|
|
28
|
+
var files = fs_1.default.readdirSync(cypressCommandsDir);
|
|
29
|
+
var commandFiles = [];
|
|
30
|
+
// Filter out non-JS/TS files and process each file
|
|
31
|
+
files.forEach(function (file) {
|
|
32
|
+
// Skip non-JS/TS files (like .d.ts, .map, etc.)
|
|
33
|
+
if (!file.endsWith('.js') && !file.endsWith('.ts')) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
// Skip index files
|
|
37
|
+
if (file === 'index.js' || file === 'index.ts') {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
// Determine the file's path
|
|
41
|
+
var filePath = path_1.default.join(cypressCommandsDir, file);
|
|
42
|
+
// Check if it's a file (not a directory)
|
|
43
|
+
var stats = fs_1.default.statSync(filePath);
|
|
44
|
+
if (!stats.isFile()) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
// Store the file name
|
|
48
|
+
commandFiles.push(file);
|
|
49
|
+
});
|
|
50
|
+
// Generate require statements and function calls
|
|
51
|
+
var requires = [];
|
|
52
|
+
var calls = [];
|
|
53
|
+
commandFiles.forEach(function (file) {
|
|
54
|
+
var requirePath = "./".concat(file);
|
|
55
|
+
// Create a safe variable name (replace non-alphanumeric with underscore)
|
|
56
|
+
var importName = file.replace(/\.(js|ts)$/, '');
|
|
57
|
+
var varName = importName.replace(/[^a-zA-Z0-9]/g, '_');
|
|
58
|
+
requires.push("const ".concat(varName, " = require('").concat(requirePath, "');"));
|
|
59
|
+
calls.push("".concat(varName, ".default();"));
|
|
60
|
+
});
|
|
61
|
+
// Build the final content
|
|
62
|
+
var content = "".concat(topOfFileComment, "\n").concat(requires.join('\n'), "\n\n").concat(calls.join('\n'));
|
|
63
|
+
// Write to the output file
|
|
64
|
+
fs_1.default.writeFileSync(outputFile, content, 'utf8');
|
|
65
|
+
};
|
|
66
|
+
exports.default = genCommandImportFile;
|
|
67
|
+
//# sourceMappingURL=genCommandImportFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genCommandImportFile.js","sourceRoot":"","sources":["../../setup/genCommandImportFile.ts"],"names":[],"mappings":";;;;;AAAA,0CAAoB;AACpB,8CAAwB;AACxB,sEAAgD;AAEhD;;;;GAIG;AACH,IAAM,oBAAoB,GAAG;IAC3B,IAAM,IAAI,GAAG,IAAA,qBAAW,GAAE,CAAC;IAE3B,IAAM,kBAAkB,GAAG,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;IAC/D,IAAM,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC;IAC7D,IAAM,gBAAgB,GAAG,mDAAmD,CAAC;IAE7E,gCAAgC;IAChC,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,kBAAkB,CAAC,EAAE,CAAC;QACvC,uBAAuB;QACvB,YAAE,CAAC,SAAS,CAAC,kBAAkB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACtD,4CAA4C;QAC5C,YAAE,CAAC,aAAa,CAAC,UAAU,EAAE,UAAG,gBAAgB,OAAI,CAAC,CAAC;QACtD,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,iCAAiC;IACjC,IAAM,KAAK,GAAG,YAAE,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC;IACjD,IAAM,YAAY,GAAa,EAAE,CAAC;IAElC,mDAAmD;IACnD,KAAK,CAAC,OAAO,CAAC,UAAC,IAAI;QACjB,gDAAgD;QAChD,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YACnD,OAAO;QACT,CAAC;QAED,mBAAmB;QACnB,IAAI,IAAI,KAAK,UAAU,IAAI,IAAI,KAAK,UAAU,EAAE,CAAC;YAC/C,OAAO;QACT,CAAC;QAED,4BAA4B;QAC5B,IAAM,QAAQ,GAAG,cAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAC;QAErD,yCAAyC;QACzC,IAAM,KAAK,GAAG,YAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACpC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;YACpB,OAAO;QACT,CAAC;QAED,sBAAsB;QACtB,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;IAEH,iDAAiD;IACjD,IAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,IAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,YAAY,CAAC,OAAO,CAAC,UAAC,IAAI;QACxB,IAAM,WAAW,GAAG,YAAK,IAAI,CAAE,CAAC;QAChC,yEAAyE;QACzE,IAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;QAClD,IAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC,eAAe,EAAE,GAAG,CAAC,CAAC;QAEzD,QAAQ,CAAC,IAAI,CAAC,gBAAS,OAAO,yBAAe,WAAW,QAAK,CAAC,CAAC;QAC/D,KAAK,CAAC,IAAI,CAAC,UAAG,OAAO,gBAAa,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;IAEH,0BAA0B;IAC1B,IAAM,OAAO,GAAG,UAAG,gBAAgB,eAAK,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAE,CAAC;IAErF,2BAA2B;IAC3B,YAAE,CAAC,aAAa,CAAC,UAAU,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;AAChD,CAAC,CAAC;AAEF,kBAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var fs_1 = __importDefault(require("fs"));
|
|
7
|
+
var path_1 = __importDefault(require("path"));
|
|
8
|
+
var getRootPath_1 = __importDefault(require("./helpers/getRootPath"));
|
|
9
|
+
/**
|
|
10
|
+
* Generate the dynamic configuration file
|
|
11
|
+
*/
|
|
12
|
+
var genDynamicConfigFile = function () {
|
|
13
|
+
var root = (0, getRootPath_1.default)();
|
|
14
|
+
var outputFile = path_1.default.join(root, 'cypress.config.ts');
|
|
15
|
+
// Create the dynamic configuration file
|
|
16
|
+
var dynamicConfigFile = [
|
|
17
|
+
'// Auto-generated by dceky - do not edit manually',
|
|
18
|
+
'',
|
|
19
|
+
'import { genConfiguration } from \'dceky\';',
|
|
20
|
+
'',
|
|
21
|
+
'export default genConfiguration();',
|
|
22
|
+
'',
|
|
23
|
+
].join('\n');
|
|
24
|
+
// Write the configuration file directly
|
|
25
|
+
fs_1.default.writeFileSync(outputFile, dynamicConfigFile, 'utf8');
|
|
26
|
+
return outputFile;
|
|
27
|
+
};
|
|
28
|
+
exports.default = genDynamicConfigFile;
|
|
29
|
+
//# sourceMappingURL=genDynamicConfigFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genDynamicConfigFile.js","sourceRoot":"","sources":["../../setup/genDynamicConfigFile.ts"],"names":[],"mappings":";;;;;AAAA,0CAAoB;AACpB,8CAAwB;AACxB,sEAAgD;AAEhD;;GAEG;AACH,IAAM,oBAAoB,GAAG;IAC3B,IAAM,IAAI,GAAG,IAAA,qBAAW,GAAE,CAAC;IAE3B,IAAM,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;IAExD,wCAAwC;IACxC,IAAM,iBAAiB,GAAG;QACxB,mDAAmD;QACnD,EAAE;QACF,6CAA6C;QAC7C,EAAE;QACF,oCAAoC;QACpC,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEb,wCAAwC;IACxC,YAAE,CAAC,aAAa,CAAC,UAAU,EAAE,iBAAiB,EAAE,MAAM,CAAC,CAAC;IAExD,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AAEF,kBAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var path_1 = __importDefault(require("path"));
|
|
7
|
+
/**
|
|
8
|
+
* Get the root path of the project
|
|
9
|
+
* @author Yuen Ler Chow
|
|
10
|
+
* @returns the root path of the project
|
|
11
|
+
*/
|
|
12
|
+
var getRootPath = function () {
|
|
13
|
+
var root = path_1.default.join(__dirname, '../../../../');
|
|
14
|
+
return root;
|
|
15
|
+
};
|
|
16
|
+
exports.default = getRootPath;
|
|
17
|
+
//# sourceMappingURL=getRootPath.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getRootPath.js","sourceRoot":"","sources":["../../../setup/helpers/getRootPath.ts"],"names":[],"mappings":";;;;;AAAA,8CAAwB;AAExB;;;;GAIG;AACH,IAAM,WAAW,GAAG;IAClB,IAAM,IAAI,GAAG,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;IAClD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,kBAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var genCommandImportFile_1 = __importDefault(require("./genCommandImportFile"));
|
|
7
|
+
var genDynamicConfigFile_1 = __importDefault(require("./genDynamicConfigFile"));
|
|
8
|
+
var addToGitIgnore_1 = __importDefault(require("./addToGitIgnore"));
|
|
9
|
+
var setupCypressDependencies_1 = __importDefault(require("./setupCypressDependencies"));
|
|
10
|
+
var checkRequiredFiles_1 = __importDefault(require("./checkRequiredFiles"));
|
|
11
|
+
(0, checkRequiredFiles_1.default)();
|
|
12
|
+
(0, genCommandImportFile_1.default)();
|
|
13
|
+
(0, genDynamicConfigFile_1.default)();
|
|
14
|
+
(0, addToGitIgnore_1.default)();
|
|
15
|
+
(0, setupCypressDependencies_1.default)();
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../setup/index.ts"],"names":[],"mappings":";;;;;AAAA,gFAA0D;AAC1D,gFAA0D;AAC1D,oEAA8C;AAC9C,wFAAkE;AAClE,4EAAsD;AAEtD,IAAA,4BAAkB,GAAE,CAAC;AACrB,IAAA,8BAAoB,GAAE,CAAC;AACvB,IAAA,8BAAoB,GAAE,CAAC;AACvB,IAAA,wBAAc,GAAE,CAAC;AACjB,IAAA,kCAAwB,GAAE,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
/* eslint-disable no-console */
|
|
7
|
+
var getRootPath_1 = __importDefault(require("./helpers/getRootPath"));
|
|
8
|
+
/**
|
|
9
|
+
* Ensure required packages exist in the consumer repo
|
|
10
|
+
* @author Yuen Ler Chow
|
|
11
|
+
*/
|
|
12
|
+
var setupCypressDependencies = function () {
|
|
13
|
+
var root = (0, getRootPath_1.default)();
|
|
14
|
+
var requiredPkgs = [
|
|
15
|
+
'cypress-parallel',
|
|
16
|
+
'cypress-multi-reporters',
|
|
17
|
+
'mochawesome',
|
|
18
|
+
'mochawesome-merge',
|
|
19
|
+
'mochawesome-report-generator',
|
|
20
|
+
];
|
|
21
|
+
var missingPkgs = requiredPkgs.filter(function (pkg) {
|
|
22
|
+
try {
|
|
23
|
+
// Resolve from the consumer project root
|
|
24
|
+
require.resolve(pkg, { paths: [root] });
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
catch (_a) {
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
if (missingPkgs.length > 0) {
|
|
32
|
+
var installCmd = "npm i -D ".concat(missingPkgs.join(' '));
|
|
33
|
+
console.error("\nMissing required devDependencies in this project: ".concat(missingPkgs.join(', ')));
|
|
34
|
+
console.error('Run the following command, then try again:');
|
|
35
|
+
console.error("\n".concat(installCmd, "\n"));
|
|
36
|
+
process.exit(1);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
exports.default = setupCypressDependencies;
|
|
40
|
+
//# sourceMappingURL=setupCypressDependencies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setupCypressDependencies.js","sourceRoot":"","sources":["../../setup/setupCypressDependencies.ts"],"names":[],"mappings":";;;;;AAAA,+BAA+B;AAC/B,sEAAgD;AAEhD;;;GAGG;AACH,IAAM,wBAAwB,GAAG;IAC/B,IAAM,IAAI,GAAG,IAAA,qBAAW,GAAE,CAAC;IAE3B,IAAM,YAAY,GAAG;QACnB,kBAAkB;QAClB,yBAAyB;QACzB,aAAa;QACb,mBAAmB;QACnB,8BAA8B;KAC/B,CAAC;IAEF,IAAM,WAAW,GAAG,YAAY,CAAC,MAAM,CAAC,UAAC,GAAG;QAC1C,IAAI,CAAC;YACH,yCAAyC;YACzC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACxC,OAAO,KAAK,CAAC;QACf,CAAC;QAAC,WAAM,CAAC;YACP,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC3B,IAAM,UAAU,GAAG,mBAAY,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAE,CAAC;QACvD,OAAO,CAAC,KAAK,CAAC,8DAAuD,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAE,CAAC,CAAC;QAC/F,OAAO,CAAC,KAAK,CAAC,4CAA4C,CAAC,CAAC;QAC5D,OAAO,CAAC,KAAK,CAAC,YAAK,UAAU,OAAI,CAAC,CAAC;QACnC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC;AAEF,kBAAe,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
namespace Cypress {
|
|
3
|
+
interface Chainable {
|
|
4
|
+
/**
|
|
5
|
+
* Assert that an element does not have a specific className
|
|
6
|
+
* @author Yuen Ler Chow
|
|
7
|
+
* @param opts object containing all arguments
|
|
8
|
+
* @param opts.item the css selector for finding the element
|
|
9
|
+
* @param opts.className the className to check for
|
|
10
|
+
* @return Cypress chainable containing the element that was checked
|
|
11
|
+
*/
|
|
12
|
+
assertDoesNotHaveClass(opts: {
|
|
13
|
+
item: string;
|
|
14
|
+
className: string;
|
|
15
|
+
}): Chainable<JQuery<HTMLElement>>;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
declare const assertDoesNotHaveClass: () => void;
|
|
20
|
+
export default assertDoesNotHaveClass;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/// <reference types="cypress" />
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
/*----------------------------------------*/
|
|
5
|
+
/* --------------- Command -------------- */
|
|
6
|
+
/*----------------------------------------*/
|
|
7
|
+
var assertDoesNotHaveClass = function () {
|
|
8
|
+
Cypress.Commands.add('assertDoesNotHaveClass', function (opts) {
|
|
9
|
+
cy.log("Assert ".concat(opts.item, " does not have class ").concat(opts.className));
|
|
10
|
+
return cy.get(opts.item).should('not.have.class', opts.className);
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
/*----------------------------------------*/
|
|
14
|
+
/* --------------- Export --------------- */
|
|
15
|
+
/*----------------------------------------*/
|
|
16
|
+
exports.default = assertDoesNotHaveClass;
|
|
17
|
+
//# sourceMappingURL=assertDoesNotHaveClass.js.map
|