andreasmarkussen / webdriver-reuse-session

Manage Webdriver/Selenium/Chromedriver sessions and make sessions id's available for e.g. Protractor and other TDD and BBD tools
MIT License
5 stars 0 forks source link

where do we put the sessionId loading code? #1

Open j-blandford opened 4 years ago

j-blandford commented 4 years ago

Where do we put this line?

const sessionIdFromFile = fs.readFileSync('.seleniumSessionId.txt')

My command to run my protractor is npm run e2e-ft -- -c=local and in the package.json the e2e-ft is this: ng e2e --suite full_test

alenl commented 4 years ago

You should put it in protractor-config.js. It might be named differently, but usually looks something like this. Put the id into the seleniumSessionId field. Eg.:

exports.config = {
  framework: 'jasmine',
  capabilities: {
    browserName: 'chrome'
  },
  seleniumSessionId: fs.readFileSync('.seleniumSessionId.txt').toString();
  // ... more config eventualy...
};
andreasmarkussen commented 2 years ago

@JamesBlandford - did this solve it for you?

if not, try to share your protractor config file.