Skip to content

Commit

Permalink
Merge pull request #16 from ShellyDCMS/remove-is-element-disabled
Browse files Browse the repository at this point in the history
remove isElementDisabled
  • Loading branch information
ShellyDCMS committed Aug 10, 2023
2 parents d1fe6ce + 34eaf6e commit e00efb9
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 34 deletions.
2 changes: 1 addition & 1 deletion documents/classes/CypressAngularComponentHelper.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[@shellygo/cypress-test-utils - v1.0.28](../README.md) / [Modules](../modules.md) / CypressAngularComponentHelper
[@shellygo/cypress-test-utils - v1.0.29](../README.md) / [Modules](../modules.md) / CypressAngularComponentHelper

# Class: CypressAngularComponentHelper<T\>

Expand Down
13 changes: 1 addition & 12 deletions documents/classes/CypressHelper.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[@shellygo/cypress-test-utils - v1.0.28](../README.md) / [Modules](../modules.md) / CypressHelper
[@shellygo/cypress-test-utils - v1.0.29](../README.md) / [Modules](../modules.md) / CypressHelper

# Class: CypressHelper

Expand Down Expand Up @@ -62,7 +62,6 @@ The get property will hold methods which will give our tests access to the “ou
| `elementsText` | (`selector`: `string`, `index?`: `number`) => `Chainable`<`string`\> |
| `env` | (`key`: `string`) => `any` |
| `inputValue` | (`selector`: `string`, `index?`: `number`) => `Chainable`<`string` \| `number` \| `string`[]\> |
| `isElementDisabled` | (`selector`: `string`, `index?`: `number`) => `Chainable`<`undefined` \| `string`\> |
| `nthBySelector` | (`selector`: `string`, `index?`: `number`, `attribute?`: `string`) => `Chainable`<`JQuery`<`HTMLElement`\>\> |
| `numberOfElements` | (`selector`: `string`) => `Chainable`<`number`\> |
| `requestBody` | (`alias`: `string`) => `PromiseLike`<`Object`\> |
Expand Down Expand Up @@ -179,16 +178,6 @@ expect(helper.get.inputValue('credentials-password').should("eq","initial passwo
-----
**isElementDisabled**: (`selector`: `string`, `index?`: `number`) => `Chainable`<`undefined` \| `string`\>
**`Example`**
```ts
expect(await helper.get.isElementDisabled('login-button').should("eq", disabled"))
```
-----
**nthBySelector**: (`selector`: `string`, `index?`: `number`, `attribute?`: `string`) => `Chainable`<`JQuery`<`HTMLElement`\>\>
Get A DOM element at a specific index from elements.
Expand Down
2 changes: 1 addition & 1 deletion documents/classes/CypressLitComponentHelper.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[@shellygo/cypress-test-utils - v1.0.28](../README.md) / [Modules](../modules.md) / CypressLitComponentHelper
[@shellygo/cypress-test-utils - v1.0.29](../README.md) / [Modules](../modules.md) / CypressLitComponentHelper

# Class: CypressLitComponentHelper

Expand Down
2 changes: 1 addition & 1 deletion documents/classes/CypressReactComponentHelper.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[@shellygo/cypress-test-utils - v1.0.28](../README.md) / [Modules](../modules.md) / CypressReactComponentHelper
[@shellygo/cypress-test-utils - v1.0.29](../README.md) / [Modules](../modules.md) / CypressReactComponentHelper

# Class: CypressReactComponentHelper

Expand Down
4 changes: 2 additions & 2 deletions documents/modules.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[@shellygo/cypress-test-utils - v1.0.28](README.md) / Modules
[@shellygo/cypress-test-utils - v1.0.29](README.md) / Modules

# @shellygo/cypress-test-utils - v1.0.28
# @shellygo/cypress-test-utils - v1.0.29

## Table of contents

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@shellygo/cypress-test-utils",
"description": "Test Automation Utilities",
"version": "1.0.28",
"version": "1.0.29",
"author": "Shelly Goldblit",
"private": false,
"license": "MIT",
Expand Down
4 changes: 2 additions & 2 deletions src/cypress-helper-spec.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,11 @@ describe("cypress helper tests", () => {
});

it("should get disabled element status", () => {
expect(get.isElementDisabled("button").should("eq", "disabled"));
expect(get.elementByTestId("button").should("be.disabled"));
});

it("should get enabled element status", () => {
expect(get.isElementDisabled("submit").should("eq", undefined));
expect(get.elementByTestId("submit").should("be.enabled"));
});

it("should spy on function", () => {
Expand Down
14 changes: 0 additions & 14 deletions src/cypress-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -473,20 +473,6 @@ Get the current URL of the page that is }
*/
numberOfElements: (selector: string): Cypress.Chainable<number> =>
this.get.bySelector(selector).its("length"),
/**
* @example
* ```ts
* expect(await helper.get.isElementDisabled('login-button').should("eq", disabled"))
* ```
* @param selector
* @param [index = 0]
* @returns {Cypress.Chainable<string | undefined>}
*/
isElementDisabled: (
selector: string,
index: number = 0
): Cypress.Chainable<string | undefined> =>
this.get.elementsAttribute(selector, "disabled", index),
/**
* @example
* ```ts
Expand Down

0 comments on commit e00efb9

Please sign in to comment.