Skip to content

Commit

Permalink
Spring-boot version uplift to 2.7.5 (#311)
Browse files Browse the repository at this point in the history
* Spring-boot-starter-parent version uplift from 2.6.3 to 2.7.5

Co-authored-by: Shubham Gupta C <[email protected]>
  • Loading branch information
shubhamkumarguptaTCS and Shubham Gupta C authored Jan 20, 2023
1 parent 1f767e4 commit f27f132
Show file tree
Hide file tree
Showing 11 changed files with 76 additions and 68 deletions.
10 changes: 4 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.ericsson</groupId>
<artifactId>eiffel-intelligence-frontend</artifactId>
<version>3.0.3</version>
<version>3.0.4</version>
<packaging>war</packaging>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.3</version>
<version>2.7.5</version>
<relativePath /> <!-- .. lookup parent from repository -->
</parent>

Expand Down Expand Up @@ -131,17 +131,15 @@
<version>4.0.0</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.mock-server/mockserver-client-java -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>3.141.0</version>
<artifactId>selenium-java</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-firefox-driver</artifactId>
<version>3.141.0</version>

<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.mock-server/mockserver-netty -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.time.Duration;

import org.apache.http.impl.client.CloseableHttpClient;
import org.junit.AfterClass;
Expand Down Expand Up @@ -97,7 +98,7 @@ private void verifyAggregatedObjectButton() throws IOException {
private void verifyAddAndRemoveEventButton() {
testRulesPage.clickAddEventButton();
testRulesPage.clickRemoveEventNumber(3);
assert (new WebDriverWait(driver, 10).until((webdriver) -> !testRulesPage.presenceOfEventNumber(3)));
assert (new WebDriverWait(driver, Duration.ofSeconds(10)).until((webdriver) -> !testRulesPage.presenceOfEventNumber(3)));
}

private void verifyUploadEventsFile() {
Expand All @@ -112,22 +113,22 @@ private void verifyDownloadEventsTemplateButton() throws IOException {
.respond(response().withStatusCode(200).withBody(downloadEventsTemplateMockedResponse));

testRulesPage.clickDownloadEventsTemplate();
new WebDriverWait(driver, 10).until((webdriver) -> Files.exists(Paths.get(DOWNLOADED_EVENTS_TEMPLATE_FILE_PATH)));
new WebDriverWait(driver, Duration.ofSeconds(10)).until((webdriver) -> Files.exists(Paths.get(DOWNLOADED_EVENTS_TEMPLATE_FILE_PATH)));
downloadedEventsTemplate = getJSONStringFromFile(DOWNLOADED_EVENTS_TEMPLATE_FILE_PATH);
assertEquals(downloadEventsTemplateMockedResponse, downloadedEventsTemplate);
}

private void verifyAddAndRemoveRuleButton() {
testRulesPage.clickAddRuleButton();
testRulesPage.clickRemoveRuleNumber(3);
assert (new WebDriverWait(driver, 10).until((webdriver) -> !testRulesPage.presenceOfRuleNumber(3)));
assert (new WebDriverWait(driver, Duration.ofSeconds(10)).until((webdriver) -> !testRulesPage.presenceOfRuleNumber(3)));
}

private void verifyDownloadRulesButton() throws IOException {
mockClient.when(request().withMethod("GET").withPath("/templates/rules"))
.respond(response().withStatusCode(200).withBody(downloadedRulesTemplate));
testRulesPage.clickDownloadRulesButton();
new WebDriverWait(driver, 10).until((webdriver) -> Files.exists(Paths.get(DOWNLOADED_RULES_FILE_PATH)));
new WebDriverWait(driver, Duration.ofSeconds(10)).until((webdriver) -> Files.exists(Paths.get(DOWNLOADED_RULES_FILE_PATH)));
String downloadedRules = getJSONStringFromFile(DOWNLOADED_RULES_FILE_PATH);
assertEquals(downloadedRulesTemplate, downloadedRules);
}
Expand All @@ -143,7 +144,7 @@ private void verifyDownloadRulesTemplateButton() throws IOException {
mockClient.when(request().withMethod("GET").withPath("/templates/rules"))
.respond(response().withStatusCode(200).withBody(mockedResponse));
testRulesPage.clickDownloadRulesTemplate();
new WebDriverWait(driver, 10).until((webdriver) -> Files.exists(Paths.get(DOWNLOADED_RULES_TEMPLATE_FILE_PATH)));
new WebDriverWait(driver, Duration.ofSeconds(10)).until((webdriver) -> Files.exists(Paths.get(DOWNLOADED_RULES_TEMPLATE_FILE_PATH)));
downloadedRulesTemplate = getJSONStringFromFile(DOWNLOADED_RULES_TEMPLATE_FILE_PATH);
assertEquals(mockedResponse, downloadedRulesTemplate);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.time.Duration;

import org.apache.http.impl.client.CloseableHttpClient;
import org.junit.AfterClass;
Expand Down Expand Up @@ -185,7 +186,7 @@ private void clickAndVerifyBulkDownloadButton() throws IOException {
subscriptionPage.loadPage();
subscriptionPage.clickCheckAll();
subscriptionPage.clickBulkDownload();
new WebDriverWait(driver, 10).until(
new WebDriverWait(driver, Duration.ofSeconds(10)).until(
(webdriver) -> Files.exists(Paths.get(DOWNLOADED_BULK_SUBSCRIPTIONS_FILE_PATH)));
String downloadedSubscriptionsTemplate = getJSONStringFromFile(
DOWNLOADED_BULK_SUBSCRIPTIONS_FILE_PATH);
Expand All @@ -194,10 +195,10 @@ private void clickAndVerifyBulkDownloadButton() throws IOException {
}

private void clickAndVerifyGetTemplateButton() throws IOException {
new WebDriverWait(driver, 10).until(
new WebDriverWait(driver, Duration.ofSeconds(10)).until(
(webdriver) -> subscriptionPage.presenceOfClickGetTemplateButton());
subscriptionPage.clickGetTemplate();
new WebDriverWait(driver, 10).until(
new WebDriverWait(driver, Duration.ofSeconds(10)).until(
(webdriver) -> Files.exists(Paths.get(DOWNLOADED_TEMPLATE_FILE_PATH)));
String subscriptionTemplate = getJSONStringFromFile(SUBSCRIPTION_TEMPLATE_FILE_PATH);
String downloadedSubscriptionsTemplate = getJSONStringFromFile(
Expand Down Expand Up @@ -289,7 +290,7 @@ private void clickCloneSubscriptionAndVerifyFormOpen() {
private void verifyViewButtonOnSubscription() {
subscriptionPage.clickExpandButtonByXPath(EXPAND_BUTTON_XPATH2);
subscriptionPage.clickButtonByXPath(VIEW_BUTTON_XPATH2);
assert (new WebDriverWait(driver, 10).until(
assert (new WebDriverWait(driver, Duration.ofSeconds(10)).until(
(webdriver) -> driver.getPageSource().contains("View Subscription")));
subscriptionPage.clickFormCloseBtn();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.ericsson.ei.frontend.pageobjects;

import java.io.IOException;
import java.time.Duration;

import org.apache.http.client.ClientProtocolException;
import org.apache.http.impl.client.CloseableHttpClient;
Expand Down Expand Up @@ -41,7 +42,7 @@ public String getTitle() {
}

public TestRulesPage clickTestRulesPage() throws IOException {
new WebDriverWait(driver, TIMEOUT_TIMER).until(ExpectedConditions.elementToBeClickable(By.xpath("//a[@href='#test-rules']")));
new WebDriverWait(driver, Duration.ofSeconds(TIMEOUT_TIMER)).until(ExpectedConditions.elementToBeClickable(By.xpath("//a[@href='#test-rules']")));
WebElement testRulesBtn = driver.findElement(By.xpath("//a[@href='#test-rules']"));
testRulesBtn.click();
TestRulesPage testRulesPage = new TestRulesPage(mockedHttpClient, driver, baseUrl);
Expand All @@ -50,7 +51,7 @@ public TestRulesPage clickTestRulesPage() throws IOException {
}

public SubscriptionPage clickSubscriptionPage() throws IOException {
new WebDriverWait(driver, TIMEOUT_TIMER).until(ExpectedConditions.elementToBeClickable(By.xpath("//a[@href='#subscriptions']")));
new WebDriverWait(driver, Duration.ofSeconds(TIMEOUT_TIMER)).until(ExpectedConditions.elementToBeClickable(By.xpath("//a[@href='#subscriptions']")));
WebElement subscriptionBtn = driver.findElement(By.xpath("//a[@href='#subscriptions']"));
subscriptionBtn.click();
SubscriptionPage subscriptionPage = new SubscriptionPage(mockedHttpClient, driver, baseUrl);
Expand All @@ -64,7 +65,7 @@ public void clickReloadButton() throws IOException {
}

public SwitchBackendPage clickSwitchBackendInstanceBtn() throws IOException {
new WebDriverWait(driver, TIMEOUT_TIMER).until(ExpectedConditions.elementToBeClickable(By.xpath("//a[@href='#switch-backend']")));
new WebDriverWait(driver, Duration.ofSeconds(TIMEOUT_TIMER)).until(ExpectedConditions.elementToBeClickable(By.xpath("//a[@href='#switch-backend']")));
WebElement switchBackendBtn = driver.findElement(By.xpath("//a[@href='#switch-backend']"));
switchBackendBtn.click();
SwitchBackendPage switchBackendPage = new SwitchBackendPage(mockedHttpClient, driver, baseUrl);
Expand All @@ -73,13 +74,13 @@ public SwitchBackendPage clickSwitchBackendInstanceBtn() throws IOException {
}

public void clickEiInfoBtn() {
new WebDriverWait(driver, TIMEOUT_TIMER).until(ExpectedConditions.elementToBeClickable(By.xpath("//a[@href='#ei-info']")));
new WebDriverWait(driver, Duration.ofSeconds(TIMEOUT_TIMER)).until(ExpectedConditions.elementToBeClickable(By.xpath("//a[@href='#ei-info']")));
WebElement eiffelInfoBtn = driver.findElement(By.xpath("//a[@href='#ei-info']"));
eiffelInfoBtn.click();
}

public InfoPage clickInformationBtn() {
new WebDriverWait(driver, TIMEOUT_TIMER).until(ExpectedConditions.elementToBeClickable(By.xpath("//a[@href='#information']")));
new WebDriverWait(driver, Duration.ofSeconds(TIMEOUT_TIMER)).until(ExpectedConditions.elementToBeClickable(By.xpath("//a[@href='#information']")));
WebElement eiInfoBtn = driver.findElement(By.xpath("//a[@href='#information']"));
eiInfoBtn.click();
InfoPage infoPage = new InfoPage(mockedHttpClient, driver, baseUrl);
Expand All @@ -88,7 +89,7 @@ public InfoPage clickInformationBtn() {
}

public InfoPage clickRulesBtn() {
new WebDriverWait(driver, TIMEOUT_TIMER).until(ExpectedConditions.elementToBeClickable(By.xpath("//a[@href='#rules']")));
new WebDriverWait(driver, Duration.ofSeconds(TIMEOUT_TIMER)).until(ExpectedConditions.elementToBeClickable(By.xpath("//a[@href='#rules']")));
WebElement eiInfoBtn = driver.findElement(By.xpath("//a[@href='#rules']"));
eiInfoBtn.click();
InfoPage infoPage = new InfoPage(mockedHttpClient, driver, baseUrl);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.ericsson.ei.frontend.pageobjects;

import java.time.Duration;

import org.apache.http.impl.client.CloseableHttpClient;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
Expand All @@ -13,7 +15,7 @@ public InfoPage(CloseableHttpClient mockedHttpClient, FirefoxDriver driver, Stri
}

public String getConnectedBackend() {
new WebDriverWait(driver, TIMEOUT_TIMER).until(ExpectedConditions.presenceOfElementLocated(By.id("connectedBackend")));
new WebDriverWait(driver, Duration.ofSeconds(TIMEOUT_TIMER)).until(ExpectedConditions.presenceOfElementLocated(By.id("connectedBackend")));
WebElement connectedBackendTextBox = driver.findElement(By.id("connectedBackend"));
return connectedBackendTextBox.getText();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

import static org.mockito.Mockito.when;

import java.time.Duration;

public class PageBaseClass {
CloseableHttpClient mockedHttpClient;
CloseableHttpResponse mockedHttpResponse;
Expand All @@ -42,7 +44,7 @@ public void refreshPage() {

public void waitForJQueryToLoad() {
try {
WebDriverWait webDriverWait = new WebDriverWait(driver, 10);
WebDriverWait webDriverWait = new WebDriverWait(driver, Duration.ofSeconds(10));
webDriverWait.until((ExpectedCondition<Boolean>) wd -> ((JavascriptExecutor) wd)
.executeScript("return document.readyState").equals("complete"));
webDriverWait.until((ExpectedCondition<Boolean>) wd -> ((JavascriptExecutor) wd)
Expand All @@ -63,7 +65,7 @@ protected CloseableHttpResponse createMockedHTTPResponse(String message, int htt
}

public void clickAlarmButton(){
new WebDriverWait(driver, TIMEOUT_TIMER).until(ExpectedConditions.elementToBeClickable(By.id("alertsLink")));
new WebDriverWait(driver, Duration.ofSeconds(TIMEOUT_TIMER)).until(ExpectedConditions.elementToBeClickable(By.id("alertsLink")));
WebElement alarmBtn = driver.findElement(By.id("alertsLink"));
alarmBtn.click();
waitForJQueryToLoad();
Expand Down
Loading

0 comments on commit f27f132

Please sign in to comment.