Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/awinogradov/dom-objects
DOM Objects declarations for tests, e2e, cypress and etc.
https://github.com/awinogradov/dom-objects
cypress dom e2e e2e-tests utils
Last synced: 3 months ago
JSON representation
DOM Objects declarations for tests, e2e, cypress and etc.
- Host: GitHub
- URL: https://github.com/awinogradov/dom-objects
- Owner: awinogradov
- License: mit
- Created: 2023-08-10T20:41:04.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-27T16:03:14.000Z (over 1 year ago)
- Last Synced: 2024-10-23T21:05:47.197Z (4 months ago)
- Topics: cypress, dom, e2e, e2e-tests, utils
- Language: TypeScript
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DOM Objects
DOM Objects declarations for tests, e2e, cypress and etc.
> npm i -D dom-objects
## Usage
``` ts
// utils/objects.ts
import { configureDomObjects } from 'dom-objects';const DO = configureDomObjects({
attributeName: 'cy',
});export const header = DO('header');
export const createMenu = header.add('createMenu');
export const createButton = createMenu.add('createButton');
`````` tsx
// src/components/button.tsx
import { createButton } from '../../utils/objects';export const Page = () => (
Submit
)
`````` ts
// cypress/e2e/test.cy.ts
import { createButton } from '../../utils/objects';describe('Test', () => {
it('must be', () => {
//...
cy.get(createButton.query).click();
//...
});
});
```### License [MIT](https://github.com/awinogradov/dom-objects/blob/main/LICENSE)