Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
a0fa666
added java sdk
abdul-qadir92 Aug 16, 2023
3e1be76
refactor the xml
abdul-qadir92 Aug 18, 2023
e0a50e7
Changes to config
abdul-qadir92 Aug 18, 2023
679d751
Update README.md
abdul-qadir92 Aug 21, 2023
2e9bb91
e Please enter the commit message for your changes. Lines starting
abdul-qadir92 Oct 5, 2023
f9915f0
a11y o11y
abdul-qadir92 Jul 29, 2024
2ef6a9e
lighthouse and percy
abdul-qadir92 Sep 10, 2024
46552c8
lighthouse and percy
abdul-qadir92 Sep 16, 2024
c76995b
platform a11y
abdul-qadir92 Oct 10, 2024
41299d1
yaml reader
abdul-qadir92 Oct 16, 2024
c08023e
Update E2E.feature
abdul-qadir92 Jan 24, 2025
e238f72
Web AI Sef Heal
abdul-qadir92 Feb 5, 2025
f4546da
jdk update
abdul-qadir92 Mar 12, 2025
6b46a18
change in proj caps for a11y
abdul-qadir92 May 28, 2025
cedfd07
Merge remote-tracking branch 'origin/sdk' into sdk
abdul-qadir92 May 28, 2025
0a02c60
Create check-quality-gate.sh
abdul-qadir92 Sep 17, 2025
2ab7e1d
Update check-quality-gate.sh
abdul-qadir92 Sep 17, 2025
6948bc7
Update check-quality-gate.sh
abdul-qadir92 Sep 17, 2025
ae0dcf6
debug check-quality-gate.sh
abdul-qadir92 Sep 17, 2025
ebe09aa
Debug check-quality-gate.sh
abdul-qadir92 Sep 17, 2025
39caf32
Debug check-quality-gate.sh
abdul-qadir92 Sep 17, 2025
14bda66
Update check-quality-gate.sh
abdul-qadir92 Sep 17, 2025
06fd387
Update check-quality-gate.sh
abdul-qadir92 Sep 17, 2025
2cfb5b9
Update check-quality-gate.sh
abdul-qadir92 Sep 17, 2025
74daff1
Add browser profiling and test orchestration options
abdul-qadir92 Nov 4, 2025
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
lighthouse and percy
  • Loading branch information
abdul-qadir92 committed Sep 16, 2024
commit 46552c859a0b1e73c5b4145eb79164650ae84d7c
14 changes: 8 additions & 6 deletions browserstack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@ platforms:
browserName: Edge
browserVersion: latest
accessibility: false
- deviceName: Samsung Galaxy S22 Ultra
- deviceName: Samsung Galaxy S2*
browserName: chrome # Try 'samsung' for Samsung browser
osVersion: 12.0
osVersion: [12131415]
accessibility: false
- deviceName: iPhone 13 Pro Max
osVersion: 15
- deviceName: iPhone 1*
browserName: safari
osVersion: [15161718]
accessibility: false
# =======================
# Parallels per Platform
Expand All @@ -68,7 +69,7 @@ browserstackAutomation: true
browserstackLocal: false # <boolean> (Default false)

# Options to be passed to BrowserStack local in-case of advanced configurations
browserStackLocalOptions:
#browserStackLocalOptions:
# localIdentifier: # <string> (Default: null) Needed if you need to run multiple instances of local.
# forceLocal: false # <boolean> (Default: false) Set to true if you need to resolve all your traffic via BrowserStack Local tunnel.
# Entire list of arguments available here -> https://www.browserstack.com/docs/automate/selenium/manage-incoming-connections
Expand All @@ -95,4 +96,5 @@ accessibilityOptions:

performance: assert
percy: true
percyCaptureMode: auto
percyCaptureMode: auto
#logLevel: debug
1 change: 0 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
<groupId>com.browserstack</groupId>
<artifactId>browserstack-java-sdk</artifactId>
<version>LATEST</version>
<scope>compile</scope>
</dependency>
</dependencies>

Expand Down
11 changes: 9 additions & 2 deletions src/test/java/Runner/CucumberTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
plugin = {"pretty","json:target/cucumber-reports/Cucumber.json"
//"com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:"
},
monochrome = true
monochrome = true,publish = true
)
@Listeners(BrowserstackTestStatusListener.class)
public class CucumberTest {
Expand Down Expand Up @@ -99,8 +99,15 @@ public void setUpHooks(String config_file, String environment) throws Exception
new URL("https://" + username + ":" + accessKey + "@" + config.get("server") + "/wd/hub"), capabilities));
}else
throw new AssertionError("Invalid input for browser");
if(!capabilities.toString().contains("realMobile"))
Map<String,String> deviceInfo = new HashMap<>();
JavascriptExecutor jse = (JavascriptExecutor) getDriver();
try{
deviceInfo = (Map<String, String>) jse.executeScript("mobile:deviceInfo");
}catch(Exception e){
}
if(deviceInfo.isEmpty())
getDriver().manage().window().maximize();

}

public static synchronized WebDriver getDriver(){
Expand Down
7 changes: 4 additions & 3 deletions src/test/java/StepDefinitions/E2ESteps.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,11 @@ public void user_is_on_home_page() {
else
hooks.driver.get(System.getProperties().getProperty("Application_url"));

jse.executeScript("browserstack_executor: {\"action\":\"lighthouseAudit\",\"arguments\":{\"url\":\""+hooks.driver.getCurrentUrl()+"\",\"executorOutput\":\"json\"}}");

jse.executeScript("browserstack_executor: {\"action\":\"lighthouseAudit\",\"arguments\":{\"url\":\""+hooks.driver.getCurrentUrl()+"\",\"assertResult\":{\"categories\":{\"performance\":40,\"best-practices\":50},\"metrics\":{\"first-contentful-paint\":{\"moreThan\":50,\"metricUnit\":\"score\"},\"largest-contentful-paint\":{\"lessThan\":4000,\"metricUnit\":\"numeric\"},\"total-blocking-time\":{\"lessThan\":600,\"metricUnit\":\"numeric\"},\"cumulative-layout-shift\":{\"moreThan\":50,\"metricUnit\":\"score\"}}}}}");
if(System.getenv("BROWSERSTACK_AUTOMATION").equalsIgnoreCase("true")) {
jse.executeScript("browserstack_executor: {\"action\":\"lighthouseAudit\",\"arguments\":{\"url\":\"" + hooks.driver.getCurrentUrl() + "\",\"executorOutput\":\"json\"}}");

jse.executeScript("browserstack_executor: {\"action\":\"lighthouseAudit\",\"arguments\":{\"url\":\"" + hooks.driver.getCurrentUrl() + "\",\"assertResult\":{\"categories\":{\"performance\":40,\"best-practices\":50},\"metrics\":{\"first-contentful-paint\":{\"moreThan\":50,\"metricUnit\":\"score\"},\"largest-contentful-paint\":{\"lessThan\":4000,\"metricUnit\":\"numeric\"},\"total-blocking-time\":{\"lessThan\":600,\"metricUnit\":\"numeric\"},\"cumulative-layout-shift\":{\"moreThan\":50,\"metricUnit\":\"score\"}}}}}");
}
}
@When("User clicks on sign in link")
public void user_clicks_on_sign_in_link() {
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/com/qa/util/BrowserstackTestStatusListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ private void markTestStatus(String status, String reason, WebDriver driver) {
public void onTestSuccess(ITestResult result) {
Object currentClass = result.getInstance();
WebDriver driver = ((CucumberTest) currentClass).getDriver();
markTestStatus("passed", "", driver);
//markTestStatus("passed", "", driver);
driver.quit();
}

Expand All @@ -31,7 +31,7 @@ public void onTestFailure(ITestResult result) {
WebDriver driver = ((CucumberTest) currentClass).getDriver();
String message = result.getThrowable().getMessage();
String reason = (message != null && message.length() > 254) ? message.substring(0, 254) : message;
markTestStatus("failed", reason.replaceAll("[^a-zA-Z0-9._-]", " "), driver);
//markTestStatus("failed", reason.replaceAll("[^a-zA-Z0-9._-]", " "), driver);
driver.quit();
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/Features/E2E.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#Description: Demonstrate Cucumber Java framework with BS Automate product
@e2e @regression
Feature: E2E Flow
Scenario Outline: TC-1480 Signed in User makes a Purchase for a product with Price and Vendor filters
Scenario Outline: TC-1856 Signed in User makes a Purchase for a product with Price and Vendor filters
Given User is on home page
When User clicks on sign in link
And User enters <username> and <password> and clicks on sign in
Expand Down
Loading