1
1
const { When, DataTable } = require ( '@cucumber/cucumber' ) ;
2
2
const { Override } = require ( '../../../utils' ) ;
3
3
const { expect } = require ( 'chai' ) ;
4
- const memory = require ( '@qavajs/memory' ) ;
5
4
6
5
When ( 'I do test' , async function ( ) { } ) ;
7
6
Override ( 'I do test' , async function ( ) {
@@ -19,8 +18,8 @@ When('I verify that config loaded', async function() {
19
18
} ) ;
20
19
21
20
When ( 'I verify that memory loaded' , async function ( ) {
22
- expect ( memory . getValue ( '$customValue' ) ) . to . equal ( 'cjs' ) ;
23
- expect ( memory . getValue ( '$additionalValue' ) ) . to . equal ( 12 ) ;
21
+ expect ( this . memory . getValue ( '$customValue' ) ) . to . equal ( 'cjs' ) ;
22
+ expect ( this . memory . getValue ( '$additionalValue' ) ) . to . equal ( 12 ) ;
24
23
} ) ;
25
24
26
25
When ( 'I verify that memory is connected to qavajs world' , async function ( ) {
@@ -51,16 +50,16 @@ When('I execute composite step', async function () {
51
50
await this . executeStep ( 'Nested step "42"' ) ;
52
51
const customDataTable = new DataTable ( [ [ '1' , '2' , '3' ] ] )
53
52
await this . executeStep ( 'Data table step:' , customDataTable ) ;
54
- expect ( memory . getValue ( '$nestedValue' ) ) . to . equal ( '42' ) ;
55
- expect ( memory . getValue ( '$dataTable' ) ) . to . deep . equal ( { rawTable : [ [ '1' , '2' , '3' ] ] } ) ;
53
+ expect ( this . memory . getValue ( '$nestedValue' ) ) . to . equal ( '42' ) ;
54
+ expect ( this . memory . getValue ( '$dataTable' ) ) . to . deep . equal ( { rawTable : [ [ '1' , '2' , '3' ] ] } ) ;
56
55
} ) ;
57
56
58
57
When ( 'Nested step {string}' , async function ( val ) {
59
- memory . setValue ( 'nestedValue' , val ) ;
58
+ this . memory . setValue ( 'nestedValue' , val ) ;
60
59
} ) ;
61
60
62
61
When ( 'Data table step:' , function ( dataTable ) {
63
- memory . setValue ( 'dataTable' , dataTable ) ;
62
+ this . memory . setValue ( 'dataTable' , dataTable ) ;
64
63
} ) ;
65
64
66
65
When ( 'Read memory {value} from cucumber type' , async function ( memoryValue ) {
@@ -69,7 +68,7 @@ When('Read memory {value} from cucumber type', async function(memoryValue) {
69
68
70
69
When ( 'write {string} to {value} value' , async function ( value , key ) {
71
70
key . set ( value ) ;
72
- expect ( memory . getValue ( '$' + key . expression ) ) . to . equal ( value ) ;
71
+ expect ( this . memory . getValue ( '$' + key . expression ) ) . to . equal ( value ) ;
73
72
} ) ;
74
73
75
74
When ( 'I expect {string} {validation} {string}' , async function ( value1 , validate , value2 ) {
0 commit comments