The CurrentPage provides convenient access to the source of the current page and to HtmlGauge functions.
Executed during beforeAll(), after logging in.
HtmlUnit reports a lot of unimportant warnings, such as: 'WARNING: Obsolete content type encountered: 'text/javascript' 'WARNING: Link type 'shortcut icon' not supported.' Therefore ScalaWebTest disables HtmlUnit's Logger per default.
HtmlUnit reports a lot of unimportant warnings, such as: 'WARNING: Obsolete content type encountered: 'text/javascript' 'WARNING: Link type 'shortcut icon' not supported.' Therefore ScalaWebTest disables HtmlUnit's Logger per default.
To see this warnings, overwrite the avoidLogSpam method.
Overwrite beforeLogin() and afterLogin() for test-specific tasks
Overwrite beforeLogin() and afterLogin() for test-specific tasks
Executed during beforeAll(), before performing any tasks
Configuration applied after login.
Configuration applied after login. Cookies may be added here.
webDriver.getPageSource wrapped in a CurrentPage
Override to encode your project specific login mechanism.
Override to encode your project specific login mechanism.
Best practice is to create a trait which overrides the login function and extends the trait Login.
For the following standard mechanisms an implementation is already available.
Configuration applied before login.
Configuration applied before login. Cookies cannot be set in this configuration. The webDriver has to open a connection, before it can set cookies
To navigate to a path during.
To navigate to a path during. For most case calling the setter on path is a better solution. Only use this function, if you group tests, which work on different paths/urls. As soon as you introduce navigateTo for one test, you should call it in all succeeding tests. This to make sure, that a test may be executed on its own.
Executed as first step during beforeAll(), can be used to modify the webdriver, based on information from the ConfigMap
Resets all cookies and logs in again
Sets a cookie for the current test.
Sets a cookie for the current test. Any cookie set through this method is discarded after a test.
config.baseUri + path as java.net.URI
uri as String
The parameterless execute method has been deprecated and will be removed in a future version of ScalaTest. Please invoke execute with empty parens instead: execute().
(Since version ScalaWebTest 3.0.0)
(Since version ScalaWebTest 3.0.0)
The trap method is no longer needed for demos in the REPL, which now abreviates stack traces, and will be removed in a future version of ScalaTest
This is the base trait for integration specs. The recommended way is to create your own project specific trait, which extends IntegrationFlatSpec or IntegrationFreeSpec, depending on the ScalaTest style which you prefer.
In you own implementation you will usually overwrite settings provided by the IntegrationSettings trait, adapted the default configuration available in loginConfig and config, and extend one of the Login traits if applicable.