selenium code clean-up (#2012)

* code clean-up

* removing extra code
This commit is contained in:
parthp2107 2022-01-04 13:56:55 +05:30 committed by GitHub
parent 348e23ca6f
commit 60ff85ccdc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 16 additions and 98 deletions

View File

@ -1,21 +0,0 @@
#!/bin/bash
# Copyright 2021 Collate
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#cd ..
echo "Maven clean package"
mvn -DskipTests clean package
echo "Docker compose up"
cd docker/local-metadata/
docker-compose up -d --build
echo "docker build done"
echo "waiting for data ingestion"
while ! wget -O /dev/null -o /dev/null localhost:8585/api/v1/teams/name/Finance; do sleep 5; done

View File

@ -1,38 +0,0 @@
/*
* Copyright 2021 Collate
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.openmetadata.catalog.selenium.initAndIngest;
import org.junit.jupiter.api.Test;
import java.io.File;
import java.io.IOException;
import java.util.logging.Logger;
public class StartServerAndIngestSampleDataTest {
private static final Logger LOG = Logger.getLogger(StartServerAndIngestSampleDataTest.class.getName());
// RUN THIS TEST FIRST
@Test
public void initAndIngestTest() throws IOException, InterruptedException {
File scriptDir = new File("../bin/initAndIngest.sh");
String absolutePath = scriptDir.getAbsolutePath();
String[] runScript = {"sh", absolutePath};
Process processRunScript = Runtime.getRuntime().exec(runScript);
processRunScript.waitFor();
LOG.info("Server started and Ingested the data");
}
}

View File

@ -167,9 +167,6 @@ public class DashboardDetailsPageTest {
Events.sendKeys(webDriver, By.cssSelector("[data-testid='searchBox']"), dashboardName); Events.sendKeys(webDriver, By.cssSelector("[data-testid='searchBox']"), dashboardName);
Events.click(webDriver, By.cssSelector("[data-testid='data-name']")); Events.click(webDriver, By.cssSelector("[data-testid='data-name']"));
Thread.sleep(waitTime); Thread.sleep(waitTime);
// actions.moveToElement(webDriver.findElement(
//
// By.xpath("//table[@data-testid='schema-table']//div[@data-testid='tag-conatiner']//span"))).perform();
Events.click( Events.click(
webDriver, webDriver,
By.xpath("//table[@data-testid='schema-table']//div[@data-testid='tag-conatiner']//span")); By.xpath("//table[@data-testid='schema-table']//div[@data-testid='tag-conatiner']//span"));

View File

@ -181,19 +181,19 @@ public class TableDetailsPageTest {
Events.click(webDriver, By.cssSelector("[data-testid='saveAssociatedTag']")); Events.click(webDriver, By.cssSelector("[data-testid='saveAssociatedTag']"));
} }
// @Test @Test
// @Order(7) @Order(7)
// public void basicChecks() throws InterruptedException { public void basicChecks() throws InterruptedException {
// openExplorePage(); openExplorePage();
// Events.sendKeys(webDriver, By.cssSelector("[data-testid='searchBox']"), tableName); Events.sendKeys(webDriver, By.cssSelector("[data-testid='searchBox']"), tableName);
// Events.click(webDriver, By.cssSelector("[data-testid='data-name']")); Events.click(webDriver, By.cssSelector("[data-testid='data-name']"));
// Thread.sleep(2000); Thread.sleep(2000);
// Events.click(webDriver, By.cssSelector("[data-testid='follow-button']")); Events.click(webDriver, By.cssSelector("[data-testid='follow-button']"));
// Events.click(webDriver, By.cssSelector("[data-testid='getFollowerDetail']")); Events.click(webDriver, By.cssSelector("[data-testid='getFollowerDetail']"));
// Events.click(webDriver, By.cssSelector("[data-testid='follow-button']")); Events.click(webDriver, By.cssSelector("[data-testid='follow-button']"));
// Events.click(webDriver, By.cssSelector("[data-testid='getFollowerDetail']")); Events.click(webDriver, By.cssSelector("[data-testid='getFollowerDetail']"));
// Events.click(webDriver, By.cssSelector("[data-testid='sample-data-button']")); Events.click(webDriver, By.cssSelector("[data-testid='sample-data-button']"));
// } }
@Test @Test
@Order(8) @Order(8)
@ -329,21 +329,7 @@ public class TableDetailsPageTest {
webDriver.findElement(By.cssSelector("[data-testid='searchBox']")).sendKeys("fact_sale"); webDriver.findElement(By.cssSelector("[data-testid='searchBox']")).sendKeys("fact_sale");
Events.click(webDriver, By.cssSelector("[data-testid='data-name']")); Events.click(webDriver, By.cssSelector("[data-testid='data-name']"));
Thread.sleep(2000); Thread.sleep(2000);
Events.click(webDriver, By.xpath("(//div[@data-testid='related-tables-data']/a)")); Events.click(webDriver, By.xpath("(//div[@data-testid='related-tables-data']//a)"));
// for (int i = 1; i <= 3; i++) {
// Events.click(webDriver, By.xpath("(//div[@data-testid='related-tables-data']//a)" + "["
// + i + "]"));
// webDriver.navigate().back();
// Thread.sleep(waitTime);
// }
// for (int i = 1; i <= 3; i++) {
// Events.click(webDriver,
// By.xpath("(//div[@data-testid='related-tables-data']//div//span)"));
// Events.click(webDriver, By.xpath("(//span[@data-testid='more-related-tables-data'])" +
// "[" + i + "]"));
// webDriver.navigate().back();
// Thread.sleep(waitTime);
// }
} }
@Test @Test

View File

@ -205,13 +205,7 @@ public class TagsPageTest {
Events.click(webDriver, By.cssSelector("[data-testid='tables']")); // Tables Events.click(webDriver, By.cssSelector("[data-testid='tables']")); // Tables
Events.click( Events.click(
webDriver, webDriver,
By.cssSelector( By.cssSelector("[data-testid='checkbox'][id='" + tagCategoryDisplayName + "." + tagDisplayName + "']"));
"[data-testid='checkbox']"
+ "[id='"
+ tagCategoryDisplayName
+ "."
+ tagDisplayName
+ "']"));
Events.click(webDriver, By.xpath("//button[@data-testid='table-link']")); Events.click(webDriver, By.xpath("//button[@data-testid='table-link']"));
} }

View File

@ -48,7 +48,7 @@ public class MyDataPageTest {
@Test @Test
@Order(2) @Order(2)
public void checkOverview() throws Exception { public void checkOverview() {
checkWhatsNew(); checkWhatsNew();
String tablesCount = webDriver.findElement(By.xpath("//div[@data-testid='tables-summary']//span[@data-testid='filter-count']")).getAttribute("innerHTML"); String tablesCount = webDriver.findElement(By.xpath("//div[@data-testid='tables-summary']//span[@data-testid='filter-count']")).getAttribute("innerHTML");
Assert.assertEquals(tablesCount, "0"); Assert.assertEquals(tablesCount, "0");