-
Notifications
You must be signed in to change notification settings - Fork 8.3k
/
e2e.ts
54 lines (46 loc) · 1.64 KB
/
e2e.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
// / <reference types="cypress" />
// ***********************************************************
// This example support/index.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************
// force ESM in this module
export {};
import 'cypress-react-selector';
// import './coverage';
declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace Cypress {
interface Chainable {
getBySel(...args: Parameters<Cypress.Chainable['get']>): Chainable<JQuery<HTMLElement>>;
getBySelContains(
...args: Parameters<Cypress.Chainable['get']>
): Chainable<JQuery<HTMLElement>>;
}
}
}
Cypress.Commands.add('getBySel', (selector, ...args) =>
cy.get(`[data-test-subj="${selector}"]`, ...args)
);
// finds elements that start with the given selector
Cypress.Commands.add('getBySelContains', (selector, ...args) =>
cy.get(`[data-test-subj^="${selector}"]`, ...args)
);
// Alternatively you can use CommonJS syntax:
// require('./commands')
Cypress.on('uncaught:exception', () => false);