Closed Jacobvu84 closed 5 years ago
webdriver {
driver = chrome
timeouts {
implicitlywait = 5000
fluentwait = 10000
}
}
headless.mode = true
serenity {
browser {
width=1200
height=800
}
restart.browser.for.each = NEVER
}
#
# Define drivers for different platforms.
# Serenity will automatically pick the correct driver for the current platform
#
drivers {
windows {
webdriver.chrome.driver = "src/test/resources/webdriver/windows/chromedriver.exe"
webdriver.gecko.driver = "src/test/resources/webdriver/windows/geckodriver.exe"
}
mac {
webdriver.chrome.driver = "src/test/resources/webdriver/mac/chromedriver"
webdriver.gecko.driver = "src/test/resources/webdriver/mac/geckodriver"
}
linux {
webdriver.chrome.driver = "src/test/resources/webdriver/linux/chromedriver"
webdriver.gecko.driver = "src/test/resources/webdriver/linux/geckodriver"
}
}
#
# This section defines environment-specific configuration for different environments.
# You can define normal Serenity properties, such as webdriver.base.url, or custom ones
# You can find more details about this feature at
# https://johnfergusonsmart.com/environment-specific-configuration-in-serenity-bdd/
#
environments {
default {
webdriver.base.url = "https://tfl.gov.uk"
}
dev {
webdriver.base.url = "https://dev.tfl.gov.uk"
}
staging {
webdriver.base.url = "https://staging.tfl.gov.uk"
}
prod {
webdriver.base.url = "https://tfl.gov.uk"
}
}
#
# Chrome options can be defined using the chrome.switches property
#
chrome.switches="""--start-maximized;
--test-type;--no-sandbox;
--ignore-certificate-errors;
--disable-popup-blocking;
--disable-default-apps;
--disable-extensions-file-access-check;
--incognito;
--disable-infobars,
--disable-gpu"""
How to access the values of the variables defined in this ?
private EnvironmentVariables environmentVariables;
String url= environmentVariables.getProperty("environments.dev.webdriver.base.url")
Tập hợp các cấu hình hữu ích