jeudi 12 décembre 2019

Why browser.get method does not go to specified url?

I have a folder structure like this: project structure

And I am following this tutorial

My package.json file is like this:

{
  "name": "node_cucumber_e2e",
  "version": "1.0.1",
  "description": "Sample E2E by Bill to learn cucumber and protractor",
  "main": "index.js",
  "scripts": {
    "start": "node index.js",
    "start-driver": "node .\\node_modules\\protractor\\bin\\webdriver-manager start",
    "update-driver": "node .\\node_modules\\protractor\\bin\\webdriver-manager update",
    "protractor": "node .\\node_modules\\protractor\\bin\\protractor configs/protractor.conf.js"
  },
  "keywords": [
    "Sample_project",
  ],
  "author": "",
  "license": "MIT",
  "devDependencies": {
    "protractor": "^5.4.2"
  }
}

I do following things:

  1. install protractor locally
  2. update webdriver-manager via npm run update-driver
  3. start webdriver-manager via npm run start-driver
  4. edit the protractor.conf like following
exports.config = {
    seleniumAddress: 'http://localhost:4444/wd/hub',
    specs: [`../tests/e2e/specs/*.js`],
    baseURL: 'http://localhost:8080/',  
    framework: 'jasmine',
  }

Then when I tried to start protractor via npm run protractor, the browser is open, however, it does not go to the url I specify and the console is this ==> output console

My spec js file is, hope someone could help me out

describe('Protractor Demo App', function() {
    it ('should have a title', function() {
        browser.get('https://juliemr.github.io/protractor-demo/');
        expect(browser.getTitle()).toEqual('Super Calculator');
    });
});

Aucun commentaire:

Enregistrer un commentaire