Skip to content

Commit 563b39c

Browse files
danygJohn Doherty
authored andcommitted
as per #21 swapped creation of page objects and shared objects
1 parent 3c8fabc commit 563b39c

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

runtime/world.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,6 @@ function World() {
9696
global[key] = runtime[key];
9797
});
9898

99-
// import page objects (after global vars have been created)
100-
if (global.pageObjectPath && fs.existsSync(global.pageObjectPath)) {
101-
102-
// require all page objects using camel case as object names
103-
runtime.page = requireDir(global.pageObjectPath, { camelcase: true });
104-
105-
// expose globally
106-
global.page = runtime.page;
107-
}
108-
10999
// import shared objects from multiple paths (after global vars have been created)
110100
if (global.sharedObjectPaths && Array.isArray(global.sharedObjectPaths) && global.sharedObjectPaths.length > 0) {
111101

@@ -130,6 +120,16 @@ function World() {
130120
}
131121
}
132122

123+
// import page objects (after global vars have been created)
124+
if (global.pageObjectPath && fs.existsSync(global.pageObjectPath)) {
125+
126+
// require all page objects using camel case as object names
127+
runtime.page = requireDir(global.pageObjectPath, { camelcase: true });
128+
129+
// expose globally
130+
global.page = runtime.page;
131+
}
132+
133133
// add helpers
134134
global.helpers = require('../runtime/helpers.js');
135135
}

0 commit comments

Comments
 (0)