added webdriver path to selenium config (#2553)

* added webdriver path to selenium config

* addressing style check
This commit is contained in:
parthp2107 2022-02-02 13:05:39 +05:30 committed by GitHub
parent 4b56d2fb0e
commit f99258ea4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 78 additions and 20 deletions

View File

@ -9,8 +9,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#OpenMetadata Url
# OpenMetadata Url
openMetadataUrl = http://localhost:8585
# WebDriver
webDriver = webdriver.chrome.driver
# WebDriver's path
webDriverPath = src/test/resources/drivers/linux/chromedriver
# Enter Time In Milliseconds
waitTime = 700

View File

@ -57,10 +57,12 @@ public class CommonTests {
static String url = Property.getInstance().getURL();
static String urlTag = "/api/v1/tags/";
String tableName = "dim_address";
String webDriverInstance = Property.getInstance().getWebDriver();
String webDriverPath = Property.getInstance().getWebDriverPath();
@BeforeEach
public void openMetadataWindow() {
System.setProperty("webdriver.chrome.driver", "src/test/resources/drivers/linux/chromedriver");
System.setProperty(webDriverInstance, webDriverPath);
ChromeOptions options = new ChromeOptions();
options.addArguments("--headless");
options.addArguments("--window-size=1280,800");

View File

@ -47,10 +47,12 @@ public class PaginationAndFilterTest {
static Actions actions;
static WebDriverWait wait;
Integer waitTime = Property.getInstance().getSleepTime();
String webDriverInstance = Property.getInstance().getWebDriver();
String webDriverPath = Property.getInstance().getWebDriverPath();
@BeforeEach
public void openMetadataWindow() {
System.setProperty("webdriver.chrome.driver", "src/test/resources/drivers/linux/chromedriver");
System.setProperty(webDriverInstance, webDriverPath);
ChromeOptions options = new ChromeOptions();
options.addArguments("--headless");
options.addArguments("--window-size=1280,800");

View File

@ -26,10 +26,12 @@ public class PostIngestionTests {
static WebDriverWait wait;
static String dashboard = "Unicode Test";
Integer waitTime = Property.getInstance().getSleepTime();
String webDriverInstance = Property.getInstance().getWebDriver();
String webDriverPath = Property.getInstance().getWebDriverPath();
@BeforeEach
public void openMetadataWindow() {
System.setProperty("webdriver.chrome.driver", "src/test/resources/drivers/linux/chromedriver");
System.setProperty(webDriverInstance, webDriverPath);
ChromeOptions options = new ChromeOptions();
options.addArguments("--headless");
options.addArguments("--window-size=1280,800");

View File

@ -33,6 +33,8 @@ public class UiExceptionHandling {
static String enterDescription = "//div[@data-testid='enterDescription']/div/div[2]/div/div/div/div/div/div";
static Faker faker = new Faker();
static String serviceName = faker.name().firstName();
String webDriverInstance = Property.getInstance().getWebDriver();
String webDriverPath = Property.getInstance().getWebDriverPath();
public void interceptor(String content, String replaceContent) {
devTools.createSession();
@ -65,7 +67,7 @@ public class UiExceptionHandling {
@BeforeEach
public void openMetadataWindow() {
System.setProperty("webdriver.chrome.driver", "src/test/resources/drivers/linux/chromedriver");
System.setProperty(webDriverInstance, webDriverPath);
ChromeOptions options = new ChromeOptions();
options.addArguments("--headless");
options.addArguments("--window-size=1280,800");

View File

@ -42,10 +42,12 @@ public class DashboardDetailsPageTest {
static String enterDescription = "//div[@data-testid='enterDescription']/div/div[2]/div/div/div/div/div/div";
static Actions actions;
static WebDriverWait wait;
String webDriverInstance = Property.getInstance().getWebDriver();
String webDriverPath = Property.getInstance().getWebDriverPath();
@BeforeEach
public void openMetadataWindow() {
System.setProperty("webdriver.chrome.driver", "src/test/resources/drivers/linux/chromedriver");
System.setProperty(webDriverInstance, webDriverPath);
ChromeOptions options = new ChromeOptions();
options.addArguments("--headless");
options.addArguments("--window-size=1280,800");

View File

@ -44,10 +44,12 @@ public class DashboardServiceTestPage {
static Actions actions;
static WebDriverWait wait;
Integer waitTime = Property.getInstance().getSleepTime();
String webDriverInstance = Property.getInstance().getWebDriver();
String webDriverPath = Property.getInstance().getWebDriverPath();
@BeforeEach
public void openMetadataWindow() {
System.setProperty("webdriver.chrome.driver", "src/test/resources/drivers/linux/chromedriver");
System.setProperty(webDriverInstance, webDriverPath);
ChromeOptions options = new ChromeOptions();
options.addArguments("--headless");
options.addArguments("--window-size=1280,800");

View File

@ -47,10 +47,12 @@ public class DatabaseServicePageTest {
static Actions actions;
static WebDriverWait wait;
Integer waitTime = Property.getInstance().getSleepTime();
String webDriverInstance = Property.getInstance().getWebDriver();
String webDriverPath = Property.getInstance().getWebDriverPath();
@BeforeEach
public void openMetadataWindow() {
System.setProperty("webdriver.chrome.driver", "src/test/resources/drivers/linux/chromedriver");
System.setProperty(webDriverInstance, webDriverPath);
ChromeOptions options = new ChromeOptions();
options.addArguments("--headless");
webDriver = new ChromeDriver(options);

View File

@ -41,10 +41,12 @@ public class IngestionPageTest {
static Actions actions;
static WebDriverWait wait;
Integer waitTime = Property.getInstance().getSleepTime();
String webDriverInstance = Property.getInstance().getWebDriver();
String webDriverPath = Property.getInstance().getWebDriverPath();
@BeforeEach
public void openMetadataWindow() {
System.setProperty("webdriver.chrome.driver", "src/test/resources/drivers/linux/chromedriver");
System.setProperty(webDriverInstance, webDriverPath);
ChromeOptions options = new ChromeOptions();
options.addArguments("--headless");
options.addArguments("--window-size=1280,800");

View File

@ -44,10 +44,12 @@ public class MessagingServicePageTest {
static Actions actions;
static WebDriverWait wait;
Integer waitTime = Property.getInstance().getSleepTime();
String webDriverInstance = Property.getInstance().getWebDriver();
String webDriverPath = Property.getInstance().getWebDriverPath();
@BeforeEach
public void openMetadataWindow() {
System.setProperty("webdriver.chrome.driver", "src/test/resources/drivers/linux/chromedriver");
System.setProperty(webDriverInstance, webDriverPath);
ChromeOptions options = new ChromeOptions();
options.addArguments("--headless");
options.addArguments("--window-size=1280,800");

View File

@ -46,10 +46,12 @@ public class MyDataPageTest {
static WebDriverWait wait;
static String table = "dim_product_variant";
Integer waitTime = Property.getInstance().getSleepTime();
String webDriverInstance = Property.getInstance().getWebDriver();
String webDriverPath = Property.getInstance().getWebDriverPath();
@BeforeEach
public void openMetadataWindow() {
System.setProperty("webdriver.chrome.driver", "src/test/resources/drivers/linux/chromedriver");
System.setProperty(webDriverInstance, webDriverPath);
ChromeOptions options = new ChromeOptions();
options.addArguments("--headless");
options.addArguments("--window-size=1280,800");

View File

@ -43,10 +43,12 @@ public class PipelineDetailsPageTest {
static String enterDescription = "//div[@data-testid='enterDescription']/div/div[2]/div/div/div/div/div/div";
static Actions actions;
static WebDriverWait wait;
String webDriverInstance = Property.getInstance().getWebDriver();
String webDriverPath = Property.getInstance().getWebDriverPath();
@BeforeEach
public void openMetadataWindow() {
System.setProperty("webdriver.chrome.driver", "src/test/resources/drivers/linux/chromedriver");
System.setProperty(webDriverInstance, webDriverPath);
ChromeOptions options = new ChromeOptions();
options.addArguments("--headless");
webDriver = new ChromeDriver(options);

View File

@ -44,10 +44,12 @@ public class PipelineServiceTestPage {
static Actions actions;
static WebDriverWait wait;
Integer waitTime = Property.getInstance().getSleepTime();
String webDriverInstance = Property.getInstance().getWebDriver();
String webDriverPath = Property.getInstance().getWebDriverPath();
@BeforeEach
public void openMetadataWindow() {
System.setProperty("webdriver.chrome.driver", "src/test/resources/drivers/linux/chromedriver");
System.setProperty(webDriverInstance, webDriverPath);
ChromeOptions options = new ChromeOptions();
options.addArguments("--headless");
options.addArguments("--window-size=1280,800");

View File

@ -35,10 +35,12 @@ public class RolesPageTest {
static Actions actions;
static WebDriverWait wait;
Integer waitTime = Property.getInstance().getSleepTime();
String webDriverInstance = Property.getInstance().getWebDriver();
String webDriverPath = Property.getInstance().getWebDriverPath();
@BeforeEach
public void openMetadataWindow() {
System.setProperty("webdriver.chrome.driver", "src/test/resources/drivers/linux/chromedriver");
System.setProperty(webDriverInstance, webDriverPath);
ChromeOptions options = new ChromeOptions();
options.addArguments("--headless");
options.addArguments("--window-size=1280,800");

View File

@ -44,10 +44,12 @@ public class TableDetailsPageTest {
static WebDriverWait wait;
Integer waitTime = Property.getInstance().getSleepTime();
String tableName = "dim_address";
String webDriverInstance = Property.getInstance().getWebDriver();
String webDriverPath = Property.getInstance().getWebDriverPath();
@BeforeEach
public void openMetadataWindow() {
System.setProperty("webdriver.chrome.driver", "src/test/resources/drivers/linux/chromedriver");
System.setProperty(webDriverInstance, webDriverPath);
ChromeOptions options = new ChromeOptions();
options.addArguments("--headless");
options.addArguments("--window-size=1280,800");

View File

@ -52,10 +52,12 @@ public class TagsPageTest {
static Actions actions;
static WebDriverWait wait;
Integer waitTime = Property.getInstance().getSleepTime();
String webDriverInstance = Property.getInstance().getWebDriver();
String webDriverPath = Property.getInstance().getWebDriverPath();
@BeforeEach
public void openMetadataWindow() {
System.setProperty("webdriver.chrome.driver", "src/test/resources/drivers/linux/chromedriver");
System.setProperty(webDriverInstance, webDriverPath);
ChromeOptions options = new ChromeOptions();
options.addArguments("--headless");
options.addArguments("--window-size=1280,800");

View File

@ -47,10 +47,12 @@ public class TeamsPageTest {
static Actions actions;
static WebDriverWait wait;
String teamsFilterCountXpath = "//div[@data-testid='terms-summary']//span[@data-testid='filter-count']";
String webDriverInstance = Property.getInstance().getWebDriver();
String webDriverPath = Property.getInstance().getWebDriverPath();
@BeforeEach
public void openMetadataWindow() {
System.setProperty("webdriver.chrome.driver", "src/test/resources/drivers/linux/chromedriver");
System.setProperty(webDriverInstance, webDriverPath);
ChromeOptions options = new ChromeOptions();
options.addArguments("--no-sandbox");
options.addArguments("--disable-dev-shm-usage");

View File

@ -42,10 +42,12 @@ public class TopicDetailsPageTest {
static Actions actions;
static WebDriverWait wait;
Integer waitTime = Property.getInstance().getSleepTime();
String webDriverInstance = Property.getInstance().getWebDriver();
String webDriverPath = Property.getInstance().getWebDriverPath();
@BeforeEach
public void openMetadataWindow() {
System.setProperty("webdriver.chrome.driver", "src/test/resources/drivers/linux/chromedriver");
System.setProperty(webDriverInstance, webDriverPath);
ChromeOptions options = new ChromeOptions();
options.addArguments("--headless");
options.addArguments("--window-size=1280,800");

View File

@ -32,10 +32,12 @@ public class UsersPageTest {
Integer waitTime = Property.getInstance().getSleepTime();
static String url = Property.getInstance().getURL();
static String urlTag = "/api/v1/tags/";
String webDriverInstance = Property.getInstance().getWebDriver();
String webDriverPath = Property.getInstance().getWebDriverPath();
@BeforeEach
public void openMetadataWindow() {
System.setProperty("webdriver.chrome.driver", "src/test/resources/drivers/linux/chromedriver");
System.setProperty(webDriverInstance, webDriverPath);
ChromeOptions options = new ChromeOptions();
options.addArguments("--headless");
options.addArguments("--window-size=1280,800");

View File

@ -23,10 +23,12 @@ public class MyDataPageTest {
static String url = Property.getInstance().getURL();
static Actions actions;
static WebDriverWait wait;
String webDriverInstance = Property.getInstance().getWebDriver();
String webDriverPath = Property.getInstance().getWebDriverPath();
@BeforeEach
public void openMetadataWindow() {
System.setProperty("webdriver.chrome.driver", "src/test/resources/drivers/linux/chromedriver");
System.setProperty(webDriverInstance, webDriverPath);
ChromeOptions options = new ChromeOptions();
options.addArguments("--headless");
options.addArguments("--window-size=1280,800");

View File

@ -21,10 +21,14 @@ public class Property {
private static Integer waitTime;
private static String URL;
private static String webDriver;
private static String webDriverPath;
private static final Object LOCK = new Object();
private static Property instance;
String openMetadataUrl = "openMetadataUrl";
String openMetadataWaitTime = "waitTime";
String openMetadataWebDriver = "webDriver";
String openMetadataWebDriverPath = "webDriverPath";
public static Property getInstance() {
if (instance == null) {
@ -45,6 +49,8 @@ public class Property {
}
URL = properties.getProperty(openMetadataUrl);
waitTime = Integer.parseInt(properties.getProperty(openMetadataWaitTime));
webDriver = properties.getProperty(openMetadataWebDriver);
webDriverPath = properties.getProperty(openMetadataWebDriverPath);
}
public static String getURL() {
@ -54,4 +60,12 @@ public class Property {
public static Integer getSleepTime() {
return waitTime;
}
public static String getWebDriver() {
return webDriver;
}
public static String getWebDriverPath() {
return webDriverPath;
}
}