webdriverio / webdriverio

Next-gen browser and mobile automation test framework for Node.js
http://webdriver.io
MIT License
9.04k stars 2.5k forks source link

Wdio CLI Wizard Improvement #6765

Closed Askarov5 closed 1 year ago

Askarov5 commented 3 years ago

Is your feature request related to a problem? Please describe.

  1. We(in the company) would like to create several webdriverio projects with the same configurations(to keep standards). Each time when a QA creates a new wdio project, he needs to ask which options to select on wdio CLI.

  2. Building UI on top of webdriverio project, and I would like to be able to create a new project by selecting options(between available reporters and services, local or cloud etc) and by clicking on the create button.

Describe the solution you'd like Improve wdio CLI Installation wizard by:

  1. Adding parameter such as --file where we can set all needed parameters then create the project based on that. It will be easy to share between the team members. For example: npx wdio config --file /project-settings.js where project-settings file(js ro json) contains object like following: { location: 'local', framework: 'mocha', sync: true, featureFileLocation: '/features', autoGenerateTests: true, usePom: true, useCompiler: false, reporters:['spec', 'HtmlReporter'], services: ['chromedriver'], baseUrl: 'https://github.com/webdriverio/webdriverio/issues' }

    1. adding parameters for each option mentioned above. For example: npx wdio config --framework mocha --location local etc
erwinheitzman commented 3 years ago

When using your suggestion, mocha would be installed but you'd have no control over the version installed. Isn't this something you'd want to manage in say, a private NPM package instead of the suggestion above so that you not only have control over the configuration but also the package versions?

Don't get me wrong, I think it's a good feature to implement but I don't see how it will help your usecase specifically so I'd like to hear from you if you do care about the version that is being installed or not.

Nonetheless we can definitely implement this

Askarov5 commented 3 years ago

For now, we don't need npm package version control. It will be enough if it works the same way as installation CLI Q-A. As far as I know, when we go through them, it will install latest/compatible versions. I believe that Simple solution will be better for QA team members(including less technical and new QA engineers) and It will be easy to share in the team without any additional actions like registration to npm or GitHub website or giving them access.

Perfect solution will be having a template(like package.json) file with all dependencies, scripts, wdio specific options such as "usePOM", "useCompiler", "localOrCloud" etc. where you can create a new project identical to the previous one.

christian-bromann commented 1 year ago

What I've seen in many companies is that they have their own configuration package that comes with smart logic around company specific infrastructure, e.g.:

import companyFooConfigHelper from '@company/wdio-config'
export const config = companyFooConfigHelper({
    // customisations here
})
  1. Adding parameter such as --file

Why not importing that "main" config and extend from it?

2. adding parameters for each option mentioned above

I don't know if that is a solution given that it seems simpler to just use the wizard rather than passing in additional parameters.

@Askarov5 any updates on this topic? Did you end up using one of the mentioned approaches or came up with something else.

christian-bromann commented 1 year ago

I will go ahead and close this. I don't think we want to add such behavior into the WebdriverIO CLI and leave it up for a company to build their own CLI for creating WebdriverIO projects.