-
Notifications
You must be signed in to change notification settings - Fork 52
Modified repo structure for Junit 4 & 5 #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@francisf - kindly review |
public class MarkSessionStatus { | ||
public void markTestStatus(String status, String reason, WebDriver driver){ | ||
JavascriptExecutor jse = (JavascriptExecutor) driver; | ||
jse.executeScript("browserstack_executor: {\"action\": \"setSessionStatus\", \"arguments\": {\"status\": \""+ status + "\", \"reason\": \"" + reason + "\"}}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible to use a hashmap instead?
{\"action\": \"setSessionStatus\", \"arguments\": {\"status\": \""+ status + "\", \"reason\": \"" + reason + "\"}}"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I replace the JSE inputs with a hashmap? Need more details on the requirement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i meant a json object, providing a direct string is making this difficult to read. we can later convert it from object to string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The syntax used is to keep it simple and inline with our docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using REST API instead of JSE
|
||
//@WebDriverTest | ||
void googleTest(WebDriver driver) { | ||
driver.get("https://google.com/"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bstack demo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed to bstackdemo.com
final String product_in_cart = wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@id=\'__next\']/div/div/div[2]/div[2]/div[2]/div/div[3]/p[1]"))).getText(); | ||
if (product_name.equals(product_in_cart)) { | ||
sessionStatus.markTestStatus("passed", "Product has been successfully added to the cart!",driver); | ||
}else{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation }else{
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
sessionStatus.markTestStatus("passed", "Local content validated!",driver); | ||
else | ||
sessionStatus.markTestStatus("failed", "Local content not validated!",driver); | ||
}catch (Exception e){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
space
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
} | ||
accesskey = System.getenv("BROWSERSTACK_ACCESS_KEY"); | ||
if(accesskey == null){ | ||
accesskey = (String) mainConfig.get("accesskey"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
accessKey = (String) config.get("key");
this was used for sel4, can we keep all the variable names and keys same?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have modified the variable names to "key" and "user" as per the capabilities doc for Selenium 3
junit-5/pom.xml
Outdated
</build> | ||
</profile> | ||
</profiles> | ||
</project> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eol
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
{ | ||
"browser": "Internet Explorer" | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please confirm if bstackdemo works on IE across win versions. Similar issue faced somewhere else
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updates in repo:
Junit 4 changes: