File tree Expand file tree Collapse file tree 4 files changed +20
-18
lines changed Expand file tree Collapse file tree 4 files changed +20
-18
lines changed Original file line number Diff line number Diff line change 1
1
/// <reference types="Cypress" />
2
2
3
- const fns = require ( '../support/functions' ) ;
4
-
5
3
describe ( 'Settings endpoints' , ( ) => {
6
4
let token ;
7
- let settingName = 'cypressSetting_' + fns . generateRandomString ( 12 ) ;
5
+ let settingName ;
8
6
9
7
before ( ( ) => {
10
8
cy . getToken ( ) . then ( ( tok ) => {
11
9
token = tok ;
12
10
} ) ;
11
+ cy . randomString ( 12 ) . then ( ( str ) => {
12
+ settingName = 'cypressSetting_' + str ;
13
+ } ) ;
13
14
} ) ;
14
15
15
16
it ( 'Should be able to create new setting' , function ( ) {
Original file line number Diff line number Diff line change 1
1
/// <reference types="Cypress" />
2
2
3
- const fns = require ( '../support/functions' ) ;
4
-
5
3
describe ( 'Users endpoints' , ( ) => {
6
4
let token ;
7
- let uniqueEmail = 'jc_' + fns . generateRandomString ( 10 ) + '@example.com' ;
8
- let myUserID = 0 ;
5
+ let uniqueEmail ;
6
+ let myUserID = 0 ;
9
7
10
8
before ( ( ) => {
11
9
cy . getToken ( ) . then ( ( tok ) => {
12
10
token = tok ;
13
11
} ) ;
12
+ cy . randomString ( 10 ) . then ( ( str ) => {
13
+ uniqueEmail = 'jc_' + str + '@example.com' ;
14
+ } ) ;
14
15
} ) ;
15
16
16
17
it ( 'Should be able to get yourself' , function ( ) {
Original file line number Diff line number Diff line change 11
11
12
12
import 'cypress-wait-until' ;
13
13
14
+ Cypress . Commands . add ( 'randomString' , ( length ) => {
15
+ var result = '' ;
16
+ var characters = 'ABCDEFGHIJK LMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' ;
17
+ var charactersLength = characters . length ;
18
+ for ( var i = 0 ; i < length ; i ++ ) {
19
+ result += characters . charAt ( Math . floor ( Math . random ( ) * charactersLength ) ) ;
20
+ }
21
+ return result ;
22
+ // cy.wrap(result);
23
+ } ) ;
24
+
14
25
/**
15
26
* Check the swagger schema:
16
27
*
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments