1

Help with info pls In my work I use webdriver.io with mocha. Right now my work folder has such structure

  1. Tests

1.1 - pageobjects - folder with page.js classes

1.2 - resources - contain - index.js with values

1.3 - specs - folder with tests

1.4 - utilities - contains helper.js with common methods

Of course wdio.conf.js is exist

Case

in specs test1.js and test2.js are created

test1.js actions

  1. login(name, password)

  2. logout

test2.js actions

  1. login(name, password)

  2. buy coffee

  3. logout

I run tests via running spec folder and tests execute one after another

So the question is how to created(mean I generate random String and initialize variable) only once and use it in every test. Another words I generate password (generate String) and use it in test1.js login action and then use it in test2.js in login action, and this password in test2.js is same.

Thx in advance!!

0 Answers0