Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing host or port configs by passing them via runner arguments #12

Closed
olimination opened this issue Dec 13, 2016 · 6 comments

Comments

Projects
None yet
2 participants
@olimination
Copy link
Member

commented Dec 13, 2016

I would like to be able to pass the host or port configs from outside the test so that I can run my tests for different environments.

Example in AEM:
Running tests for Author and Publish.

Solution Proposal:
As far as I have seen the ScalaTest ConfigMap seems to be for such cases: http://doc.scalatest.org/3.0.0/index.html#org.scalatest.ConfigMap

@DaniRey

This comment has been minimized.

Copy link
Member

commented Dec 14, 2016

Great idea!

Do you want to create a pull request? We could also organize a pair programming session to implement this. Should be doable before season holidays.

@DaniRey DaniRey added the enhancement label Jan 6, 2017

@DaniRey

This comment has been minimized.

Copy link
Member

commented Sep 28, 2018

@olimination Are you still interested in this change?

@DaniRey DaniRey added this to the 3.0.0 milestone Sep 28, 2018

@olimination

This comment has been minimized.

Copy link
Member Author

commented Oct 8, 2018

@DaniRey Interested yes, but I'm currently struggling with my available time capacity and priorities. I leave it unassigned, and if I see any spare time, I would like to implement it. Maybe I can integrate it within a next project :)

@DaniRey

This comment has been minimized.

Copy link
Member

commented Oct 8, 2018

I'm already halfway there with the implementation 😀

But I would like to have some user feedback before finishing it. I'll keep you posted about the implementation.

DaniRey added a commit that referenced this issue Mar 25, 2019

Changing host or port configs by passing them via runner arguments #12
 - merge host and loginPath/basePath into config/loginConfig.useBaseURI, this makes configuration consistent (always in config object) and allows for cleaner configuration via command line arguments

DaniRey added a commit that referenced this issue Mar 28, 2019

@DaniRey

This comment has been minimized.

Copy link
Member

commented May 5, 2019

I tried configMap and it has two issues.

  1. configMap is only initialized (available) when using org.scalatest.tools.Runner to run the test (usually not the case)
  2. configMap would require additional indirection, because we have to delay the initialization of the webdriver until we receive the configMap

Therefore we decided to use System.getProperty and System.getenv and provide the Configurable abstraction to access the information. There is already a working implementation of this approach in https://github.com/unic/ScalaWebTest/tree/feature/scalawebtest-74-wip used to control the webdriver path.

@DaniRey DaniRey referenced this issue May 31, 2019

Closed

Update Documentation for 3.0.0 #79

9 of 9 tasks complete

DaniRey added a commit that referenced this issue Jun 1, 2019

Changing host or port configs by passing them via runner arguments #12
- merge host and loginPath/basePath into config.useBaseUri/loginConfig.useLoginUri, this makes configuration consistent (always in config object) and allows for cleaner configuration via command line arguments
- config.baseUri can be overwritten with the system.property(scalawebtest.base.uri), the environment variable (scalawebtest.base.uri or SCALAWEBTEST_BASE_URI), or the run argument (scalawebtest.base.uri)
- loginConfig.loginUri can be overwritten with the system.property(scalawebtest.login.uri), the environment variable (scalawebtest.login.uri or SCALAWEBTEST_LOGIN_URI), or the run argument (scalawebtest.login.uri)
- the extension points (or methods) login, beforeLogin and afterLogin now receive the configMap as well. This allows to read run arguments and make use of the Configurable trait in those methods
- reactivate the BasicAuthLogin trait, which got broken during the implementation for #74
@DaniRey

This comment has been minimized.

Copy link
Member

commented Jun 1, 2019

  • Merged host and loginPath/basePath into config.useBaseUri/loginConfig.useLoginUri, this makes configuration consistent (always in config object) and allows for cleaner configuration via command line arguments

  • config.baseUri can be overwritten with the system.property(scalawebtest.base.uri), the environment variable (scalawebtest.base.uri or SCALAWEBTEST_BASE_URI), or the run argument (scalawebtest.base.uri)

  • loginConfig.loginUri can be overwritten with the system.property(scalawebtest.login.uri), the environment variable (scalawebtest.login.uri or SCALAWEBTEST_LOGIN_URI), or the run argument (scalawebtest.login.uri)

@DaniRey DaniRey closed this Jun 1, 2019

DaniRey added a commit that referenced this issue Jun 1, 2019

Changing host or port configs by passing them via runner arguments #12
- delete asWebClientExposingDriverOrError in ResponseAccessors, because it inherits this method from IntegrationSpec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.