Skip to content

Commit

Permalink
Merge pull request #385 from dn0000001/smoke-test-fixes
Browse files Browse the repository at this point in the history
Fix Smoke Test suite due to website changes
  • Loading branch information
dn0000001 authored Oct 7, 2023
2 parents a2ebddc + 7c9a8a3 commit c1c54c8
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class CsvFileDownloadPage extends PageObjectV2 {
private static final String LINK_HTTP_STATUS = "Link HTTP Status";

@XStreamOmitField
@FindBy(css = "h3 [href$='Research-and-development-survey-2021-CSV-notes.csv']")
@FindBy(css = "h3 [href$='research-and-development-survey-2022-csv-notes.csv']")
private WebComponent downloadLink;

public CsvFileDownloadPage() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class PrimeFacesSelectManyCheckboxPage extends PageObjectV2 {
private static final String VALUE_TO_BE_SET = "true";
private static final BasicClock clock = new BasicClock();

@FindBy(xpath = "//table[contains(@id, 'basic')]//label[text()='Option 1']/..")
@FindBy(xpath = "//*[contains(@id, 'basic')]//label[text()='Option 1']/..")
private CheckBoxLabel option1;

public PrimeFacesSelectManyCheckboxPage() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import ru.yandex.qatools.allure.annotations.Step;

public class PrimeFacesSelectOneRadioPage extends PageObjectV2 {
@FindBy(css = ".ui-selectoneradio[id$=':console'] td")
@FindBy(css = ".ui-selectoneradio[id$=':line'] [role='radio']")
private PrimeFacesRadioButtonGroup basic;

public PrimeFacesSelectOneRadioPage() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ public void performTest() {
AssertJUtil.assertThat(getContext().getDriver().getCurrentUrl()).as("Changed Context URL").contains(SITE_2_VALIDATION);
AssertJUtil.assertThat(Utils.getStoredTestProperties().getBrowserType()).as("Changed Test Properties").isEqualTo(EXPECTED_BROWSER);

// Random actions to prevent 'Failed to shutdown Driver Command Executor' that seems to occur
// if you shutdown the browser too fast after launching.
new HerokuappDataTableEqualsTest().verifyTable1EqualsTable2Test();

Utils.restoreBrowser();
AssertJUtil.assertThat(getContext().getDriver().getCurrentUrl()).as("Restored Context URL Diff").doesNotContain(SITE_2_VALIDATION);
AssertJUtil.assertThat(getContext().getDriver().getCurrentUrl()).as("Restored Context URL Same").contains(SITE_1_VALIDATION);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static void takeScreenshot(String title) {
if (context() != null && context().getDriver() != null) {
try {
Utils.until(ExpectedConditionsUtil.takeScreenshot(title)).forEach(Attachment::build);
} catch (Exception ex) {
} catch (Exception | AssertionError ex) {
String shortMessage = "Could not take screenshot for " + title;
StringWriter sw = new StringWriter();
ex.printStackTrace(new PrintWriter(sw));
Expand All @@ -73,7 +73,7 @@ public static void takeHTML(String title) {
if (AppiumDriver.class.isAssignableFrom(context().getDriver().getClass())) {
type = "text/xml";
}
} catch (Exception ex) {
} catch (Exception | AssertionError ex) {
String shortMessage = "Could not take HTML for " + title;
StringWriter sw = new StringWriter();
ex.printStackTrace(new PrintWriter(sw));
Expand Down

0 comments on commit c1c54c8

Please sign in to comment.