@m4l/testing 0.0.22 → 0.0.23-AQ200320226-2.beta
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/e2e/commands/components/Accordions/commands.d.ts +4 -0
- package/e2e/commands/components/Accordions/commands.js +19 -0
- package/e2e/commands/components/Accordions/types.d.ts +63 -0
- package/e2e/commands/components/CommonActions/commands.d.ts +4 -0
- package/e2e/commands/components/CommonActions/commands.js +11 -0
- package/e2e/commands/components/CommonActions/types.d.ts +20 -0
- package/e2e/commands/components/DataGrid/commands.d.ts +1 -1
- package/e2e/commands/components/DataGrid/commands.js +29 -29
- package/e2e/commands/components/DataGrid/types.d.ts +109 -24
- package/e2e/commands/components/DynamicFilter/commands.d.ts +1 -1
- package/e2e/commands/components/DynamicFilter/types.d.ts +10 -3
- package/e2e/commands/components/DynamicSort/commands.d.ts +1 -1
- package/e2e/commands/components/DynamicSort/types.d.ts +17 -1
- package/e2e/commands/components/Filters/commands.d.ts +4 -0
- package/e2e/commands/components/Filters/commands.js +24 -0
- package/e2e/commands/components/Filters/types.d.ts +91 -0
- package/e2e/commands/components/Form/commands.d.ts +4 -0
- package/e2e/commands/components/Form/commands.js +11 -0
- package/e2e/commands/components/Form/cypress/assertInitialFormState/assertInitialFormState.d.ts +5 -0
- package/e2e/commands/components/Form/cypress/assertInitialFormState/assertInitialFormState.js +20 -0
- package/e2e/commands/components/Form/cypress/assertInitialFormState/type.d.ts +105 -0
- package/e2e/commands/components/Form/cypress/assertInitialFormState/type.js +1 -0
- package/e2e/commands/components/Form/cypress/assertMandatoryFields/assertMandatoryFields.d.ts +17 -0
- package/e2e/commands/components/Form/cypress/assertMandatoryFields/assertMandatoryFields.js +14 -0
- package/e2e/commands/components/Form/cypress/assertMandatoryFields/type.d.ts +28 -0
- package/e2e/commands/components/Form/cypress/assertMandatoryFields/type.js +1 -0
- package/e2e/commands/components/Form/cypress/constants.d.ts +3 -0
- package/e2e/commands/components/Form/cypress/constants.js +6 -0
- package/e2e/commands/components/Form/cypress/fillAndAssertFormFields/fillAndAssertFormFields.d.ts +8 -0
- package/e2e/commands/components/Form/cypress/fillAndAssertFormFields/fillAndAssertFormFields.js +29 -0
- package/e2e/commands/components/Form/cypress/fillAndAssertFormFields/type.d.ts +5 -0
- package/e2e/commands/components/Form/cypress/fillAndAssertFormFields/type.js +1 -0
- package/e2e/commands/components/Form/cypress/getFormScope/getFormScope.d.ts +20 -0
- package/e2e/commands/components/Form/cypress/getFormScope/getFormScope.js +8 -0
- package/e2e/commands/components/Form/cypress/proceedFormStep/proceedFormStep.d.ts +10 -0
- package/e2e/commands/components/Form/cypress/proceedFormStep/proceedFormStep.js +6 -0
- package/e2e/commands/components/Form/cypress/proceedFormStep/type.d.ts +13 -0
- package/e2e/commands/components/Form/helpers/getFieldNameDomElement.d.ts +7 -0
- package/e2e/commands/components/Form/helpers/getFieldNameDomElement.js +13 -0
- package/e2e/commands/components/Form/types.d.ts +88 -0
- package/e2e/commands/components/MenuActions/commands.d.ts +1 -1
- package/e2e/commands/components/MenuActions/commands.js +2 -2
- package/e2e/commands/components/MenuActions/types.d.ts +16 -1
- package/e2e/commands/components/Popover/commands.d.ts +1 -1
- package/e2e/commands/components/Popover/types.d.ts +6 -0
- package/e2e/commands/components/PropertyValue/commands.d.ts +1 -1
- package/e2e/commands/components/PropertyValue/types.d.ts +9 -4
- package/e2e/commands/components/Tab/commands.d.ts +1 -1
- package/e2e/commands/components/Tab/commands.js +3 -2
- package/e2e/commands/components/Tab/types.d.ts +19 -4
- package/e2e/commands/components/WindowBase/commands.d.ts +1 -1
- package/e2e/commands/components/WindowBase/commands.js +18 -10
- package/e2e/commands/components/WindowBase/types.d.ts +89 -7
- package/e2e/commands/components/index.d.ts +4 -0
- package/e2e/commands/index.d.ts +6 -0
- package/e2e/commands/register.d.ts +1 -2
- package/e2e/commands/register.js +11 -7
- package/e2e/cypress.d.js +1 -0
- package/e2e/cypress.d.ts +5 -1
- package/index.d.ts +1 -0
- package/index.js +23 -23
- package/package.json +33 -76
- package/testComponents/DataGrid/helpers.js +52 -30
- package/testComponents/DataGrid/types.d.ts +15 -3
- package/e2e/commands/components/DataGrid/export.d.ts +0 -7
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
interface BaseInput {
|
|
2
|
+
/**
|
|
3
|
+
* Index of the field in the form
|
|
4
|
+
*/
|
|
5
|
+
index?: number;
|
|
6
|
+
/**
|
|
7
|
+
* Value of the field visible by default
|
|
8
|
+
*/
|
|
9
|
+
valueVisibleByDefault?: string;
|
|
10
|
+
}
|
|
11
|
+
interface InputWithoutOptions extends BaseInput {
|
|
12
|
+
/**
|
|
13
|
+
* Type of the element in the form (input, textarea)
|
|
14
|
+
*/
|
|
15
|
+
typeElement: 'input' | 'textarea';
|
|
16
|
+
/**
|
|
17
|
+
* Type of the value of the input (string, number)
|
|
18
|
+
*/
|
|
19
|
+
typeValue?: 'string' | 'number';
|
|
20
|
+
/**
|
|
21
|
+
* Value to write in the input
|
|
22
|
+
*/
|
|
23
|
+
valueToWrite?: string;
|
|
24
|
+
}
|
|
25
|
+
interface InputWithOptions extends BaseInput {
|
|
26
|
+
typeElement: 'select';
|
|
27
|
+
/**
|
|
28
|
+
* Alias of the endpoint to wait for. (Cypress alias syntax with intercept)
|
|
29
|
+
* Example: '@localesList'
|
|
30
|
+
*/
|
|
31
|
+
endpointToWait: string;
|
|
32
|
+
/**
|
|
33
|
+
* Options of the autocomplete. Only used for autocompleteAsync or select type.
|
|
34
|
+
*/
|
|
35
|
+
options: string[];
|
|
36
|
+
/**
|
|
37
|
+
* Index to select in the list of options
|
|
38
|
+
* by default is index 0 (first option)
|
|
39
|
+
*/
|
|
40
|
+
optionIndexToSelect?: number;
|
|
41
|
+
}
|
|
42
|
+
export type InputsForm = InputWithoutOptions | InputWithOptions;
|
|
43
|
+
interface AssertInitialFormStateBaseParams {
|
|
44
|
+
/**
|
|
45
|
+
* Endpoint to wait for. (Cypress alias syntax with intercept)
|
|
46
|
+
* Example: '@getForm'
|
|
47
|
+
*/
|
|
48
|
+
endpointToWait?: string;
|
|
49
|
+
}
|
|
50
|
+
export type InitialField = Omit<InputsForm, 'valueToWrite' | 'optionIndexToSelect' | 'options' | 'valueVisibleByDefault'> & {
|
|
51
|
+
/**
|
|
52
|
+
* Expected value of the field when form is initially loaded. By default is empty string.
|
|
53
|
+
* Example: 'demo_operative'
|
|
54
|
+
*/
|
|
55
|
+
expectedValue?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Whether the field should be enabled on initial load.
|
|
58
|
+
* By default the assertion expects enabled.
|
|
59
|
+
*/
|
|
60
|
+
enabled?: boolean;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Step to validate.
|
|
64
|
+
* Example:
|
|
65
|
+
* {
|
|
66
|
+
* stepperIndex: 1,
|
|
67
|
+
* inputs: [{ typeElement: 'input', valueVisibleByDefault: '' }]
|
|
68
|
+
* }
|
|
69
|
+
*/
|
|
70
|
+
export interface Step {
|
|
71
|
+
/**
|
|
72
|
+
* Stepper index to validate.
|
|
73
|
+
* Example: 1
|
|
74
|
+
*/
|
|
75
|
+
stepperIndex: number;
|
|
76
|
+
/**
|
|
77
|
+
* Inputs to validate in the selected step.
|
|
78
|
+
*/
|
|
79
|
+
inputs: InitialField[];
|
|
80
|
+
}
|
|
81
|
+
export interface AssertInitialFormStateWithStepper extends AssertInitialFormStateBaseParams {
|
|
82
|
+
/**
|
|
83
|
+
* Steps to validate.
|
|
84
|
+
* Example:
|
|
85
|
+
* [{ stepperIndex: 1, inputs: [{ typeElement: 'input', valueVisibleByDefault: '' }] }]
|
|
86
|
+
*/
|
|
87
|
+
steps: Step[];
|
|
88
|
+
/**
|
|
89
|
+
* Label of the next button.
|
|
90
|
+
* By default: 'N_D:[stepper.label_next_button]'
|
|
91
|
+
*/
|
|
92
|
+
labelNextButton?: string;
|
|
93
|
+
inputs?: never;
|
|
94
|
+
}
|
|
95
|
+
export interface AssertInitialFormStateWithoutStepper extends AssertInitialFormStateBaseParams {
|
|
96
|
+
/**
|
|
97
|
+
* Inputs to validate when the form has no stepper.
|
|
98
|
+
* Example:
|
|
99
|
+
* [{ typeElement: 'input', index: 0, expectedValue: '' }]
|
|
100
|
+
*/
|
|
101
|
+
inputs: InitialField[];
|
|
102
|
+
steps?: never;
|
|
103
|
+
}
|
|
104
|
+
export type AssertInitialFormState = AssertInitialFormStateWithStepper | AssertInitialFormStateWithoutStepper;
|
|
105
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AssertMandatoryFields } from './type';
|
|
2
|
+
/**
|
|
3
|
+
* function to assert mandatory fields
|
|
4
|
+
* @param props - The properties to assert mandatory fields
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* formFieldItems: [
|
|
8
|
+
* {
|
|
9
|
+
* name: 'name',
|
|
10
|
+
* evaluateField: true,
|
|
11
|
+
* mandatory: true,
|
|
12
|
+
* },
|
|
13
|
+
* ],
|
|
14
|
+
* propertyValueSelector: '[data-testid="m4l-property-value-root-name"]',
|
|
15
|
+
* }
|
|
16
|
+
*/
|
|
17
|
+
export declare const assertMandatoryFields: ({ formFieldItems, propertyValueSelector }: AssertMandatoryFields) => void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { g as r } from "../getFormScope/getFormScope.js";
|
|
2
|
+
const a = (s, e) => r().find(`${e}[data-testid*="${s}"]`), l = ({ formFieldItems: s, propertyValueSelector: e }) => {
|
|
3
|
+
s.forEach((t) => {
|
|
4
|
+
if (t.evaluateField !== !1)
|
|
5
|
+
if (a(t.name, e).should("contain.text", t.label), t.mandatory === !0) {
|
|
6
|
+
const o = a(t.name, e).find('[class*="M4LHelperError-root"]');
|
|
7
|
+
o.should("exist"), o.should("be.visible");
|
|
8
|
+
} else
|
|
9
|
+
a(t.name, e).find('[class*="M4LHelperError-root"]').should("not.exist");
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
l as a
|
|
14
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type FormConfig = {
|
|
2
|
+
name: string;
|
|
3
|
+
label: string;
|
|
4
|
+
evaluateField: boolean;
|
|
5
|
+
mandatory?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export interface AssertMandatoryFields {
|
|
8
|
+
/**
|
|
9
|
+
* Form field items to assert if are mandatory
|
|
10
|
+
* @example
|
|
11
|
+
* [
|
|
12
|
+
* {
|
|
13
|
+
* name: 'name',
|
|
14
|
+
* value: 'John Doe',
|
|
15
|
+
* evaluateValue: true,
|
|
16
|
+
* text: 'Name',
|
|
17
|
+
* mandatory: true,
|
|
18
|
+
* },
|
|
19
|
+
* ]
|
|
20
|
+
*/
|
|
21
|
+
formFieldItems: FormConfig[];
|
|
22
|
+
/**
|
|
23
|
+
* Property value selector to assert mandatory fields. This property containts the selector of the property value of the form field.
|
|
24
|
+
* @example
|
|
25
|
+
* '[data-testid="m4l-property-value-root-name"]'
|
|
26
|
+
*/
|
|
27
|
+
propertyValueSelector: string;
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/e2e/commands/components/Form/cypress/fillAndAssertFormFields/fillAndAssertFormFields.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FillAndAssertFormFields } from './type';
|
|
2
|
+
/**
|
|
3
|
+
* Fill and validate the inputs of the form with the data of the form
|
|
4
|
+
* @param inputs - The inputs to validate
|
|
5
|
+
* @param stepIndex - The step index to get the scope of the form
|
|
6
|
+
* @returns void
|
|
7
|
+
*/
|
|
8
|
+
export declare const fillAndAssertFormFields: ({ inputs, stepIndex }: FillAndAssertFormFields) => void;
|
package/e2e/commands/components/Form/cypress/fillAndAssertFormFields/fillAndAssertFormFields.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { g as r } from "../../helpers/getFieldNameDomElement.js";
|
|
2
|
+
import { g as i } from "../getFormScope/getFormScope.js";
|
|
3
|
+
const c = (l) => l.get('[class*="MuiAutocomplete-listbox"]').find('[class*="MuiMenuItem-root"]'), d = ({ inputs: l, stepIndex: s }) => {
|
|
4
|
+
l.forEach((e, a) => {
|
|
5
|
+
const o = i(s).find(r(e.typeElement)).eq(e?.index ?? a);
|
|
6
|
+
switch (e.valueVisibleByDefault && o.should("have.value", e.valueVisibleByDefault), e.typeElement) {
|
|
7
|
+
case "input":
|
|
8
|
+
if (e.typeValue === "number") {
|
|
9
|
+
const t = "text string testing";
|
|
10
|
+
o.type(t).should("not.have.value", t);
|
|
11
|
+
}
|
|
12
|
+
e.valueToWrite && o.should("be.visible").click().type(e.valueToWrite).should("have.value", e.valueToWrite);
|
|
13
|
+
break;
|
|
14
|
+
case "textarea":
|
|
15
|
+
e.valueToWrite && o.should("be.visible").click().type(e.valueToWrite);
|
|
16
|
+
break;
|
|
17
|
+
case "select":
|
|
18
|
+
if (o.should("be.visible").click(), e.endpointToWait && cy.wait(e.endpointToWait), e.options) {
|
|
19
|
+
for (let t = 0; t < e.options.length; t++)
|
|
20
|
+
c(o).eq(t).should("contain.text", e.options?.[t]);
|
|
21
|
+
c(o).eq(e.optionIndexToSelect ?? 0).click(), i(s).find("input").eq(e?.index ?? a).should("have.value", e.options?.[0]);
|
|
22
|
+
}
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
d as f
|
|
29
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Function to get the scope of the form based on the step index (if provided)
|
|
3
|
+
* or the whole form if no step index is provided
|
|
4
|
+
* @param stepIndex - The step index to get the scope of the form
|
|
5
|
+
* @returns The scope of the form. Examples:
|
|
6
|
+
* - Example with stepper:
|
|
7
|
+
* ```ts
|
|
8
|
+
* cy.get('[class*="M4LWindowBase-contentWindowBase"]')
|
|
9
|
+
* .find('[class*="M4LStepper-contentArea"]')
|
|
10
|
+
* .find('[class*="M4LStepper-stepContent"]')
|
|
11
|
+
* .eq(1)
|
|
12
|
+
* .find('[class*="M4LPaperForm-containerContent"]');
|
|
13
|
+
* ```
|
|
14
|
+
* - Example without stepper:
|
|
15
|
+
* ```ts
|
|
16
|
+
* cy.get('[class*="M4LWindowBase-contentWindowBase"]')
|
|
17
|
+
* .find('[class*="M4LPaperForm-containerContent"]');
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare const getFormScope: (stepIndex?: number) => Cypress.Chainable<JQuery<HTMLElement>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ProceedFormStep } from './type';
|
|
2
|
+
/**
|
|
3
|
+
* Function to proceed to the next step or submit the form by clicking the button with the given label
|
|
4
|
+
* @param buttonLabel - The label of the button to click
|
|
5
|
+
* @param force - The force to click the button if true, the button will be clicked with force
|
|
6
|
+
* @returns The click action of the button with the given label
|
|
7
|
+
* @example
|
|
8
|
+
* cy.proceedFormStep({ buttonLabel: 'N_D:[stepper.label_next_button]', force: false });
|
|
9
|
+
*/
|
|
10
|
+
export declare const proceedFormStep: ({ buttonLabel, force }: ProceedFormStep) => void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface ProceedFormStep {
|
|
2
|
+
/**
|
|
3
|
+
* The label of the button to click
|
|
4
|
+
* @example
|
|
5
|
+
* 'N_D:[stepper.label_next_button]'
|
|
6
|
+
*/
|
|
7
|
+
buttonLabel: string;
|
|
8
|
+
/**
|
|
9
|
+
* The force to click the button if true, the button will be clicked with force
|
|
10
|
+
* @default false
|
|
11
|
+
*/
|
|
12
|
+
force?: boolean;
|
|
13
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { InputsForm } from '../cypress/assertInitialFormState/type';
|
|
2
|
+
/**
|
|
3
|
+
* Function to get the name of the DOM element based on the type of the element
|
|
4
|
+
* @param typeElement - The type of the element
|
|
5
|
+
* @returns The name of the DOM element
|
|
6
|
+
*/
|
|
7
|
+
export declare const getFieldNameDomElement: (typeElement: InputsForm["typeElement"]) => "input" | "textarea";
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { AssertInitialFormState } from './cypress/assertInitialFormState/type';
|
|
2
|
+
import { AssertMandatoryFields } from './cypress/assertMandatoryFields/type';
|
|
3
|
+
import { ProceedFormStep } from './cypress/proceedFormStep/type';
|
|
4
|
+
import { FillAndAssertFormFields } from './cypress/fillAndAssertFormFields/type';
|
|
5
|
+
|
|
6
|
+
declare global {
|
|
7
|
+
namespace Cypress {
|
|
8
|
+
interface Chainable {
|
|
9
|
+
/**
|
|
10
|
+
* Assert initial state of a Form, with or without stepper.
|
|
11
|
+
* You need send the params with the inputs to validate.
|
|
12
|
+
* @example
|
|
13
|
+
* // Option 1: Without stepper
|
|
14
|
+
* cy.m4lAssertInitialFormState({
|
|
15
|
+
* inputs: [{ typeElement: 'input', index: 0, expectedValue: 'John Doe' }],
|
|
16
|
+
* });
|
|
17
|
+
* // Option 2: With stepper
|
|
18
|
+
* cy.m4lAssertInitialFormState({
|
|
19
|
+
* steps: [{ stepperIndex: 1, inputs: [{ typeElement: 'input', index: 0, expectedValue: 'John Doe' }] }],
|
|
20
|
+
* });
|
|
21
|
+
*/
|
|
22
|
+
m4lAssertInitialFormState (params: AssertInitialFormState): Chainable<void>
|
|
23
|
+
/**
|
|
24
|
+
* function to assert mandatory fields
|
|
25
|
+
* @param props - The properties to assert mandatory fields
|
|
26
|
+
* @example
|
|
27
|
+
* {
|
|
28
|
+
* formFieldItems: [
|
|
29
|
+
* {
|
|
30
|
+
* name: 'name',
|
|
31
|
+
* evaluateField: true,
|
|
32
|
+
* mandatory: true,
|
|
33
|
+
* },
|
|
34
|
+
* ],
|
|
35
|
+
* propertyValueSelector: '[data-testid="m4l-property-value-root-name"]',
|
|
36
|
+
* }
|
|
37
|
+
*/
|
|
38
|
+
m4lAssertMandatoryFields (params: AssertMandatoryFields): Chainable<void>
|
|
39
|
+
/**
|
|
40
|
+
* Function to get the scope of the form based on the step index (if provided)
|
|
41
|
+
* or the whole form if no step index is provided
|
|
42
|
+
* @param stepIndex (optional) - The step index to get the scope of the form
|
|
43
|
+
* @returns The scope of the form. Examples:
|
|
44
|
+
* - Example with stepper:
|
|
45
|
+
* ```ts
|
|
46
|
+
* cy.get('[class*="M4LWindowBase-contentWindowBase"]')
|
|
47
|
+
* .find('[class*="M4LStepper-contentArea"]')
|
|
48
|
+
* .find('[class*="M4LStepper-stepContent"]')
|
|
49
|
+
* .eq(1)
|
|
50
|
+
* .find('[class*="M4LPaperForm-containerContent"]');
|
|
51
|
+
* ```
|
|
52
|
+
* - Example without stepper:
|
|
53
|
+
* ```ts
|
|
54
|
+
* cy.get('[class*="M4LWindowBase-contentWindowBase"]')
|
|
55
|
+
* .find('[class*="M4LPaperForm-containerContent"]');
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
m4lGetFormScope (stepIndex?: number): Chainable<JQuery<HTMLElement>>
|
|
59
|
+
/**
|
|
60
|
+
* Fill and validate the inputs of the form with the data of the form
|
|
61
|
+
* @param inputs - The inputs to validate
|
|
62
|
+
* @param stepIndex - The step index to get the scope of the form
|
|
63
|
+
* @returns Chainable<void>
|
|
64
|
+
* @example
|
|
65
|
+
* cy.m4lFillAndAssertFormFields({
|
|
66
|
+
* inputs: [
|
|
67
|
+
* { typeElement: 'input', index: 0, valueToWrite: 'John Doe' },
|
|
68
|
+
* { typeElement: 'textarea', index: 0, valueToWrite: 'John Doe' },
|
|
69
|
+
* { typeElement: 'select', index: 0, options: ['Option 1', 'Option 2'], optionIndexToSelect: 0, endpointToWait: '@getOptions' },
|
|
70
|
+
* ],
|
|
71
|
+
* stepIndex: 1,
|
|
72
|
+
* });
|
|
73
|
+
*/
|
|
74
|
+
m4lFillAndAssertFormFields (params: FillAndAssertFormFields): Chainable<void>
|
|
75
|
+
/**
|
|
76
|
+
* Function to proceed to the next step or submit the form by clicking the button with the given label
|
|
77
|
+
* @param buttonLabel - The label of the button to click
|
|
78
|
+
* @param force - The force to click the button if true, the button will be clicked with force
|
|
79
|
+
* @returns Chainable<void>
|
|
80
|
+
* @example
|
|
81
|
+
* cy.proceedFormStep({ buttonLabel: 'N_D:[stepper.label_next_button]', force: false });
|
|
82
|
+
*/
|
|
83
|
+
m4lProceedFormStep (params: ProceedFormStep): Chainable<void>
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export { };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const o = () => {
|
|
2
|
-
Cypress.Commands.add("m4lMenuActionsItem", (e) => {
|
|
3
|
-
cy.m4lPopover().find("[role=menuitem]").eq(e).should("be.visible", { timeout: 1e4 });
|
|
2
|
+
Cypress.Commands.add("m4lMenuActionsItem", (e, s) => {
|
|
3
|
+
cy.m4lPopover().find("[role=menuitem]").eq(e), s ? cy.should("have.attr", "aria-disabled", "true") : cy.should("be.visible", { timeout: 1e4 });
|
|
4
4
|
});
|
|
5
5
|
};
|
|
6
6
|
export {
|
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
declare global {
|
|
2
2
|
namespace Cypress {
|
|
3
3
|
interface Chainable {
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Gets the MenuItem of a MenuAction at the specified position. Optionally asserts disabled state.
|
|
6
|
+
* @example
|
|
7
|
+
* cy.m4lMenuActionsItem(0); // first item, expect visible
|
|
8
|
+
* cy.m4lMenuActionsItem(1, 'isDisabled'); // second item, expect disabled
|
|
9
|
+
*/
|
|
10
|
+
m4lMenuActionsItem(
|
|
11
|
+
/**
|
|
12
|
+
* menuActions item index
|
|
13
|
+
*/
|
|
14
|
+
menuItemIndex: number,
|
|
15
|
+
/**
|
|
16
|
+
* Indicates whether the menuActions item is disabled
|
|
17
|
+
*/
|
|
18
|
+
isDisabled?: 'isDisabled',
|
|
19
|
+
): Chainable<Element>
|
|
5
20
|
}
|
|
6
21
|
}
|
|
7
22
|
}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
declare global {
|
|
2
2
|
namespace Cypress {
|
|
3
3
|
interface Chainable {
|
|
4
|
+
/**
|
|
5
|
+
* Gets the currently open popover (MUI Paper with role=presentation).
|
|
6
|
+
* @example
|
|
7
|
+
* cy.m4lDynamicFilterInputClick();
|
|
8
|
+
* cy.m4lPopover().find('li').contains('Name').click();
|
|
9
|
+
*/
|
|
4
10
|
m4lPopover(): Chainable<Element>
|
|
5
11
|
}
|
|
6
12
|
}
|
|
@@ -2,11 +2,16 @@ declare global {
|
|
|
2
2
|
namespace Cypress {
|
|
3
3
|
interface Chainable {
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
* @
|
|
7
|
-
*
|
|
5
|
+
* Gets the PropertyValue element (value part) within the given selector.
|
|
6
|
+
* @example
|
|
7
|
+
* cy.m4lPropertyValue('[class*="M4LPropertyValue-root"]').should('have.text', '123');
|
|
8
8
|
*/
|
|
9
|
-
m4lPropertyValue(
|
|
9
|
+
m4lPropertyValue(
|
|
10
|
+
/**
|
|
11
|
+
* Property selector
|
|
12
|
+
*/
|
|
13
|
+
selector: string,
|
|
14
|
+
): Chainable<Element>
|
|
10
15
|
}
|
|
11
16
|
}
|
|
12
17
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const a = () => {
|
|
2
|
-
Cypress.Commands.add("m4lTabButton", (
|
|
3
|
-
cy.get(
|
|
2
|
+
Cypress.Commands.add("m4lTabButton", (o, s, t) => {
|
|
3
|
+
const n = cy.get(o).find("[role=tablist]").find("button").eq(s);
|
|
4
|
+
t !== void 0 && n.should("have.text", t);
|
|
4
5
|
});
|
|
5
6
|
};
|
|
6
7
|
export {
|
|
@@ -2,11 +2,26 @@ declare global {
|
|
|
2
2
|
namespace Cypress {
|
|
3
3
|
interface Chainable {
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
* @
|
|
7
|
-
*
|
|
5
|
+
* Gets the tab button at the given index and asserts its text equals tabTitle.
|
|
6
|
+
* @example
|
|
7
|
+
* cy.m4lTabButton('[class*="M4LTab-root"]', 0); // Without title
|
|
8
|
+
* cy.m4lTabButton('[class*="M4LTab-root"]', 0, 'Details');
|
|
9
|
+
* cy.m4lTabButton('[class*="M4LTab-root"]', 1, 'History');
|
|
8
10
|
*/
|
|
9
|
-
m4lTabButton(
|
|
11
|
+
m4lTabButton(
|
|
12
|
+
/**
|
|
13
|
+
* @param selector - The component selector to get the tab button
|
|
14
|
+
*/
|
|
15
|
+
selector: string,
|
|
16
|
+
/**
|
|
17
|
+
* @param tabIndex - The tab index to get the button
|
|
18
|
+
*/
|
|
19
|
+
tabIndex: number,
|
|
20
|
+
/**
|
|
21
|
+
* @param tabTitle - The tab title to validate
|
|
22
|
+
*/
|
|
23
|
+
tabTitle?: string,
|
|
24
|
+
): Chainable<Element>
|
|
10
25
|
}
|
|
11
26
|
}
|
|
12
27
|
}
|
|
@@ -1,16 +1,24 @@
|
|
|
1
|
-
const
|
|
1
|
+
const e = () => {
|
|
2
2
|
Cypress.Commands.add("m4lWindowBaseHeader", () => {
|
|
3
3
|
cy.get('[class^="M4LDragResizeWindowRND-draggableHandle"]').find('[class^="M4LDragResizeWindowRND-draggableCancel"]');
|
|
4
|
-
}), Cypress.Commands.add("m4lWindowBaseLeftAction", (
|
|
5
|
-
cy.m4lWindowBaseHeader().find("button").eq(
|
|
6
|
-
}), Cypress.Commands.add("m4lWindowBaseLeftActionClick", (
|
|
7
|
-
cy.m4lWindowBaseLeftAction(
|
|
8
|
-
}), Cypress.Commands.add("m4lWindowBaseMenuAction", (
|
|
9
|
-
cy.m4lWindowBaseHeader().find('[class*="M4LMenuActions-root-M4LWindowBase-menuActionsWindowBase"]').find("button").eq(0).click(), cy.get("[role=presentation]").find('[class^="MuiPaper-root"]').find("[role=menuitem]").eq(
|
|
10
|
-
}), Cypress.Commands.add("m4lWindowBaseMenuActionDisabled", (
|
|
11
|
-
cy.m4lWindowBaseMenuAction(
|
|
4
|
+
}), Cypress.Commands.add("m4lWindowBaseLeftAction", (s) => {
|
|
5
|
+
cy.m4lWindowBaseHeader().find("button").eq(s);
|
|
6
|
+
}), Cypress.Commands.add("m4lWindowBaseLeftActionClick", (s) => {
|
|
7
|
+
cy.m4lWindowBaseLeftAction(s).click({ force: !0 });
|
|
8
|
+
}), Cypress.Commands.add("m4lWindowBaseMenuAction", (s) => {
|
|
9
|
+
cy.m4lWindowBaseHeader().find('[class*="M4LMenuActions-root-M4LWindowBase-menuActionsWindowBase"]').find("button").eq(0).click(), cy.get("[role=presentation]").find('[class^="MuiPaper-root"]').find("[role=menuitem]").eq(s);
|
|
10
|
+
}), Cypress.Commands.add("m4lWindowBaseMenuActionDisabled", (s) => {
|
|
11
|
+
cy.m4lWindowBaseMenuAction(s).should("have.attr", "aria-disabled", "true");
|
|
12
|
+
}), Cypress.Commands.add("m4lDialogWindowActions", (s) => {
|
|
13
|
+
cy.get('[class^="MuiDialog-container"]').find('[class^="M4LWindowBase-root"]').should("contain", s);
|
|
14
|
+
}), Cypress.Commands.add("m4lDialogWindowActionsValidateTitle", (s) => {
|
|
15
|
+
cy.get('[class^="M4LGridLayout-root"]').find('[class*="M4LPopupsViewer-root"]').find('[class*="M4LDragResizeWindowRND-draggableHandle"]').find('[class*="M4LTypography-root"]').should("have.text", s);
|
|
16
|
+
}), Cypress.Commands.add("m4lAssertModuleHeaderTitle", (s) => {
|
|
17
|
+
cy.get('[class*="M4LWindowBase-root"]').find('[class*="M4LWindowBase-headerContentWindowBase"]').find('[class*="M4LWindowBase-containerTitleSubtitle"]').should("be.visible").should("contain.text", s);
|
|
18
|
+
}), Cypress.Commands.add("m4lAssertModuleHeaderIcon", (s) => {
|
|
19
|
+
cy.get('[class*="M4LWindowBase-root"]').find('[class*="M4LWindowBase-headerContentWindowBase"]').find('[class*="M4LIcon-root"]').find('[class*="M4LIcon-icon"]').should("be.visible").invoke("css", "mask").should("contain", s);
|
|
12
20
|
});
|
|
13
21
|
};
|
|
14
22
|
export {
|
|
15
|
-
|
|
23
|
+
e as r
|
|
16
24
|
};
|