https://github.com/humansignal/ls-frontend-test
Frontend test suite with Cypress
https://github.com/humansignal/ls-frontend-test
Last synced: about 1 year ago
JSON representation
Frontend test suite with Cypress
- Host: GitHub
- URL: https://github.com/humansignal/ls-frontend-test
- Owner: HumanSignal
- Created: 2023-03-30T17:44:43.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-01-31T15:45:14.000Z (over 2 years ago)
- Last Synced: 2024-02-01T16:56:57.478Z (over 2 years ago)
- Language: TypeScript
- Size: 240 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This is pre-configured Cypress testing environment packed with helpers for each UI element that exists in Label Studio
# Install
If you want to install it to a new repo, run the following
```bash
# Create test folder
mkdir __test__
# Change dir
cd __test__
# Init new package with all defaults
yarn init --yes
# Add ls-test to the package
yarn add git+ssh://git@github.com/heartexlabs/ls-frontend-test.git
# Run a built-in init script to setup your environment
yarn run lstest init
```
It will init a new module package and will install everything you need.
After that run
- `yarn test` for console-based testing
- `yarn test:ui` from Cypress UI
# Using helpers
In you spec file:
```javascript
// For LSF Specific helpers
import { LabelStudio } from '@heartexlabs/ls-test/helpers/LSF';
// Or for all available helpers
import { LSF } from '@heartexlabs/ls-test/helpers';
// Usage
describe('Test', () => {
it("Should pass", () => {
LSF.LabelStudio.init({
config: '',
task: { annotations: [], predictions: [] }
});
});
});
```