Giter Club home page Giter Club logo

Comments (11)

juliemr avatar juliemr commented on May 18, 2024

e.g. username / password for login

from protractor.

jgrund avatar jgrund commented on May 18, 2024

👍

from protractor.

juliemr avatar juliemr commented on May 18, 2024

Here's my proposal for this: protractor should export its configuration object as protractor.config. A 'params' section will be added, and made modifiable by command line. So the config file

exports.config = {
  params: {
    username: 'julie',
    password: '1234'
  },
  // ... whatever else you need
}

and then the command line
protractor --params username=fred --params additional=foo

Would result in your tests having access to:

protractor.config; // equals {username: 'fred', password: '1234', additional: 'foo'}

Does this meet everyone's needs?

from protractor.

dgurjar22 avatar dgurjar22 commented on May 18, 2024

👍

from protractor.

andresdominguez avatar andresdominguez commented on May 18, 2024

Would you allow the config params to have a deep structure? For example, would you be able to modify this?

exports.config = {
  params: {
    login: {
      user: 'julie',
      password: '1234'
    }
  }
}

Would you be able to change this?

protractor --params login.user=fred

from protractor.

zakrhol avatar zakrhol commented on May 18, 2024

protractor.config; // equals {username: 'fred', password: '1234', additional: 'foo'}

config is always undefined with protractor version 1.0.0.
According to the changeset (Commit) it must be
protractor.getInstance().params.username

from protractor.

stevenmanton avatar stevenmanton commented on May 18, 2024

or just browser.params.password works for me

from protractor.

nvega-ms avatar nvega-ms commented on May 18, 2024

Can I remove a parameter byu command line?

from protractor.

orgimeno avatar orgimeno commented on May 18, 2024

Hi, i have two questions.

// conf.js
exports.config = {
    framework: 'jasmine',
    seleniumAddress: 'http://localhost:4444/wd/hub',
    specs: [],
    multiCapabilities: [{
        'browserName': 'chrome',
        'specs': ['protractor-spec.js'],
        'count': 5, //number of instances
        'shardTestFiles': true, //execute instances of browser simultaneously
    },
    ],
    params: {
        answers: {
            max:10,
            min:1,
        }
    },
}
  • I have this configuration and i want change count value in multiCapabilities via command line. its that possible?
  • Can i run different instances of webDriver i the same browser but different tabs?

from protractor.

felippenardi avatar felippenardi commented on May 18, 2024

Just for the records, the way to do it is:

protractor --params.login.user 'Joe' --params.login.password 'abc'

As in 02cb819

from protractor.

djom202 avatar djom202 commented on May 18, 2024

Can I use it for pass to config.js file the tags that I would like run?. For example:

protractor --params.tags '@issues, @results, ~@todo'

In my config.js file:

exports.config = {
    framework: 'jasmine',
    specs: [],
    multiCapabilities: [{
        'browserName': 'chrome',
        'specs': ['features/*.feature'],
        'shardTestFiles': true, //execute instances of browser simultaneously
    }],
    cucumberOpts: {
        require: ['step_definitions/**/*_steps.js'],
        format: 'pretty',
        tags: config.tags,
        keepAlive: false
    },
    params: {
        tags: "@complete"
    },
}

from protractor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.