Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
jdrodjpl committed Apr 10, 2024
1 parent 6c04a1e commit 8bbed3f
Showing 1 changed file with 21 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,12 @@ public void runValidateButtonTest() {

waitForElementID("validateAndSaveSnippetsSubmitBtn");
log.info("Clicking on 'Validate and Save' button.");
driver.findElement(By.id("validateAndSaveSnippetsSubmitBtn")).click();

WebElement validateAndSaveButton = driver.findElement(By.id("validateAndSaveSnippetsSubmitBtn"));
JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("arguments[0].scrollIntoViewIfNeeded();", validateAndSaveButton);

validateAndSaveButton.click();

log.info("Verifying 'Saved the snippets' shows up on the page.");
if(findOnPage("Saved the snippets")) {
Expand Down Expand Up @@ -219,7 +224,11 @@ public void runUpdateSnippetTest() throws IOException {

waitForElementID("validateAndSaveSnippetsSubmitBtn");
log.info("Clicking on 'Validate and Save' button...");
driver.findElement(By.id("validateAndSaveSnippetsSubmitBtn")).click();

WebElement validateAndSaveButton = driver.findElement(By.id("validateAndSaveSnippetsSubmitBtn"));
js.executeScript("arguments[0].scrollIntoViewIfNeeded();", validateAndSaveButton);

validateAndSaveButton.click();

log.info("Verifying 'Saved the snippets' shows up on the page.");
if(findOnPage("Saved the snippets")) {
Expand Down Expand Up @@ -255,7 +264,11 @@ public void runUpdateErrorTest() throws IOException {

waitForElementID("validateAndSaveSnippetsSubmitBtn");
log.info("Clicking on 'Validate and Save' button");
driver.findElement(By.id("validateAndSaveSnippetsSubmitBtn")).click();

WebElement validateAndSaveButton = driver.findElement(By.id("validateAndSaveSnippetsSubmitBtn"));
js.executeScript("arguments[0].scrollIntoViewIfNeeded();", validateAndSaveButton);

validateAndSaveButton.click();

log.info("Looking for 'ERROR: invalid code.' on page.");
if(findOnPage("ERROR: invalid code.")) {
Expand Down Expand Up @@ -293,7 +306,11 @@ public void runReloadEditorTest() throws IOException {

waitForElementID("validateAndSaveSnippetsSubmitBtn");
log.info("Clicking on 'Validate and Save' button");
driver.findElement(By.id("validateAndSaveSnippetsSubmitBtn")).click();

WebElement validateAndSaveButton = driver.findElement(By.id("validateAndSaveSnippetsSubmitBtn"));
js.executeScript("arguments[0].scrollIntoViewIfNeeded();", validateAndSaveButton);

validateAndSaveButton.click();

log.info("Looking for 'ERROR: invalid code.' on page.");
if(findOnPage("ERROR: invalid code.")) {
Expand Down

0 comments on commit 8bbed3f

Please sign in to comment.