This is what I have in protractor.conf.js:
let localNodeStorage = require('./helpers/localStorageNode');
exports.config ={onPrepare: async () => {
require('ts-node').register({
project: require('path').join(__dirname, './tsconfig.e2e.json')
});
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
await browser.driver.get('https://xpert-integration.gdp3000.com/gdpadminui/login');
localNodeStorage.clear();
await browser.driver.findElement(by.css('#username')).sendKeys('user');
await browser.driver.findElement(by.css('#password')).sendKeys('pass');
await browser.driver.findElement(by.css('.btn-enter')).click();
localNodeStorage.getValue("AuthenticationToken").then((token) => {
let authToken= token;
console.log(authToken);
});}};
Is there a way to access authToken
in my login.ts class? And if so, how?
I tried params{}
but it won't work
If I just get token from localStorage in login.ts I get authToken undefined.