Comments (4)
Can you put the configuration in the test helper? (I assume umbrellas have a test helper for each app)
from wallaby.
Thanks for replying. I tried adding this to my admin app in app/apps/admin_app/test/test_helper.exs
import Config
config :wallaby,
otp_app: :admin_app,
driver: Wallaby.Chrome,
screenshot_dir: "wallaby_screenshots",
# Wallaby should take screenshots on test failures
screenshot_on_failure: true,
# Amount of time that Wallaby should wait to find an element on the page.
max_wait_time: 5000,
# Throw JavaScript errors in elixir
js_errors: true,
# IO device where JavaScript console logs are written
js_logger: :stdio,
chromedriver: [
headless: true
]
{:ok, _} = Application.ensure_all_started(:wallaby)
Application.put_env(:wallaby, :base_url, MyApp.AdminApp.Endpoint.url())
But on trying to run tests I get a
** (RuntimeError) could not set configuration via Config. This usually means you are trying to execute a configuration file directly, instead of reading it with Config.Reader
I guess configs are to be set only at compile time
from wallaby.
Sorry, I meant by doing Application.put_env
from wallaby.
Thanks a lot @mhanberg that solved my problem.
For anyone encountering the same issue, this is how I set my wallaby configs now, I have set the configurations separately for the different apps in their respective test_helper.exs
files and I no longer set the configs in the config/test.exs
files
Application.put_all_env([
{
:wallaby,
otp_app: :web_app,
driver: Wallaby.Chrome,
screenshot_dir: "wallaby_screenshots",
screenshot_on_failure: true,
max_wait_time: 5000,
js_errors: true,
js_logger: :stdio,
chromedriver: [
headless: true
]
}
])
{:ok, _} = Application.ensure_all_started(:wallaby)
Application.put_env(:wallaby, :base_url, ConnectWeb.Endpoint.url())
from wallaby.
Related Issues (20)
- chromedriver 115.0.5790.102 not working HOT 10
- Passed capabilities may be passed in the wrong format HOT 1
- Modify capabilities while keeping metadata in user agent HOT 2
- Wallaby test issue HOT 1
- js_errors: false config is being ignored
- Is it possible to configure "headless: true | false" at session opening? HOT 2
- Chrome is activated but the test times out HOT 4
- Test cases fail randomely because of missing elements HOT 3
- `run_command.sh` improvements HOT 1
- Running wallaby `feature` tests in VS Code HOT 1
- Minor thing: change wording of docs --> browser / users are not the same. HOT 2
- Suggested Phoenix Configuration for Concurrent Feature Test Issues Warning HOT 1
- How Might A Developer New to Wallaby Understand 'page' In the Documentation? HOT 5
- Setup docs unclear when using Phoenix but not Ecto HOT 3
- Use external chromedriver server? HOT 8
- Debug output HOT 5
- Warning on Elixir 1.17.0-rc.1: `ExUnit.Case.register_test/4 is deprecated` HOT 3
- How to send API Requests in parallel? HOT 4
- Getting Selenium (Firefox & Safari) working in Wallaby (~> 0.30.x) HOT 1
- Unable to use Wallaby in release mode
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wallaby.