Skip to content

Commit a9940f9

Browse files
Charankumar HCharankumar H
authored andcommitted
Added IST timezone for CI/CD and browsers.
1 parent 4b213a1 commit a9940f9

File tree

7 files changed

+18
-7
lines changed

7 files changed

+18
-7
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ jobs:
118118

119119
- name: Send Results to Discord
120120
env:
121+
TZ: 'Asia/Kolkata'
121122
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
122123
run: |
123124
# Gather metrics from test-summary output
@@ -187,6 +188,7 @@ jobs:
187188

188189
- name: Send Results to Discord
189190
env:
191+
TZ: 'Asia/Kolkata'
190192
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
191193
run: |
192194
# Gather metrics from test-summary output
@@ -258,6 +260,7 @@ jobs:
258260

259261
- name: Send Results to Discord
260262
env:
263+
TZ: 'Asia/Kolkata'
261264
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
262265
run: |
263266
# Gather metrics from test-summary output

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ Automated end-to-end testing framework built with Playwright and Java, tailored
1515
for scalability and maintainability, this framework covers critical test scenarios with robust assertions and clean,
1616
modular code. Perfect for those looking to speed up their test automation journey or enhance their Playwright skills!
1717

18-
Thanks to [The Pocket](https://github.com/The-Pocket/PocketFlow-Tutorial-Codebase-Knowledge) for beautifully generating an entire easy-to-understand tutorial for this GitHub Repo.
18+
Thanks to [The Pocket](https://github.com/The-Pocket/PocketFlow-Tutorial-Codebase-Knowledge) for beautifully generating
19+
an entire easy-to-understand tutorial for this GitHub Repo.
1920
Massive respect for creating such a wonderful tool. Simply Brilliant! ❤️
2021

21-
You can read the entire tutorial [here](https://code2tutorial.com/tutorial/81c3753d-35c2-41fd-941c-34a1c851e80c/index.md).
22+
You can read the entire
23+
tutorial [here](https://code2tutorial.com/tutorial/81c3753d-35c2-41fd-941c-34a1c851e80c/index.md).
2224

2325
# TEST ARCHITECTURE
2426

@@ -53,7 +55,6 @@ You can read the entire tutorial [here](https://code2tutorial.com/tutorial/81c37
5355

5456
<img width="1697" alt="Browser_Creation_Flow" src="https://github.com/user-attachments/assets/34f8530d-33a7-4612-9346-2fc5958f41da" />
5557

56-
5758
# CHROME DEVTOOLS PROTOCOL IMPLEMENTATION EXPLAINED
5859

5960
**1. Initialize the CDP Session**
@@ -125,6 +126,8 @@ You can read the entire tutorial [here](https://code2tutorial.com/tutorial/81c37
125126
| 4 | Firefox | Headless | `mvn clean test -Drunmode=headless -Dbrowser=firefox -Dgroups=SWAG_LABS_SMOKE,SWAG_LABS_REGRESSION,SWAG_LABS_E2E -Dthreads=3 -Ddataproviderthreadcount=3` |
126127
| 5 | Edge | Local | `mvn clean test -Dbrowser=msedge -Dgroups=SWAG_LABS_SMOKE,SWAG_LABS_REGRESSION,SWAG_LABS_E2E -Dthreads=3 -Ddataproviderthreadcount=3` |
127128
| 6 | Edge | Headless | `mvn clean test -Drunmode=headless -Dbrowser=msedge -Dgroups=SWAG_LABS_SMOKE,SWAG_LABS_REGRESSION,SWAG_LABS_E2E -Dthreads=3 -Ddataproviderthreadcount=3` |
129+
| 7 | WebKit | Local | `mvn clean test -Dbrowser=msedge -Dgroups=SWAG_LABS_SMOKE,SWAG_LABS_REGRESSION,SWAG_LABS_E2E -Dthreads=3 -Ddataproviderthreadcount=3` |
130+
| 8 | WebKit | Headless | `mvn clean test -Drunmode=headless -Dbrowser=msedge -Dgroups=SWAG_LABS_SMOKE,SWAG_LABS_REGRESSION,SWAG_LABS_E2E -Dthreads=3 -Ddataproviderthreadcount=3` |
128131

129132
**NOTE**: These above commands (no testng.xml required) will run the tests in parallel with the specified thread count
130133
and with the respective groups and thread counts.

src/main/java/io/swaglabs/portal/qa/browsermanager/ChromeBrowser.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public BrowserContext createSession(Playwright playwright, boolean isHeadless) {
1313
return playwright.chromium().launch(new BrowserType.LaunchOptions()
1414
.setHeadless(isHeadless))
1515
.newContext(new Browser.NewContextOptions()
16-
.setViewportSize(WebPortalConstants.SCREEN_WIDTH, WebPortalConstants.SCREEN_HEIGHT));
16+
.setViewportSize(WebPortalConstants.SCREEN_WIDTH, WebPortalConstants.SCREEN_HEIGHT)
17+
.setTimezoneId(WebPortalConstants.TIME_ZONE));
1718
}
1819
}

src/main/java/io/swaglabs/portal/qa/browsermanager/FirefoxBrowser.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ public BrowserContext createSession(Playwright playwright, boolean isHeadless) {
1212
return playwright.firefox().launch(new BrowserType.LaunchOptions()
1313
.setHeadless(isHeadless))
1414
.newContext(new Browser.NewContextOptions()
15-
.setViewportSize(WebPortalConstants.SCREEN_WIDTH, WebPortalConstants.SCREEN_HEIGHT));
15+
.setViewportSize(WebPortalConstants.SCREEN_WIDTH, WebPortalConstants.SCREEN_HEIGHT)
16+
.setTimezoneId(WebPortalConstants.TIME_ZONE));
1617
}
1718
}

src/main/java/io/swaglabs/portal/qa/browsermanager/MsEdgeBrowser.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ public BrowserContext createSession(Playwright playwright, boolean isHeadless) {
1212
return playwright.chromium().launch(new BrowserType.LaunchOptions()
1313
.setHeadless(isHeadless).setChannel(BrowserName.MS_EDGE.getBrowserType()))
1414
.newContext(new Browser.NewContextOptions()
15-
.setViewportSize(WebPortalConstants.SCREEN_WIDTH, WebPortalConstants.SCREEN_HEIGHT));
15+
.setViewportSize(WebPortalConstants.SCREEN_WIDTH, WebPortalConstants.SCREEN_HEIGHT)
16+
.setTimezoneId(WebPortalConstants.TIME_ZONE));
1617
}
1718
}

src/main/java/io/swaglabs/portal/qa/browsermanager/WebkitBrowser.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ public BrowserContext createSession(Playwright playwright, boolean isHeadless) {
1212
return playwright.webkit().launch(new BrowserType.LaunchOptions()
1313
.setHeadless(isHeadless))
1414
.newContext(new Browser.NewContextOptions()
15-
.setViewportSize(WebPortalConstants.SCREEN_WIDTH, WebPortalConstants.SCREEN_HEIGHT));
15+
.setViewportSize(WebPortalConstants.SCREEN_WIDTH, WebPortalConstants.SCREEN_HEIGHT)
16+
.setTimezoneId(WebPortalConstants.TIME_ZONE));
1617
}
1718
}

src/main/java/io/swaglabs/portal/qa/constants/WebPortalConstants.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public final class WebPortalConstants {
1616
// DYNAMIC BROWSER & ENVIRONMENT CHOICE
1717
public static final String RUN_MODE = System.getProperty("runmode");
1818
public static final String BROWSER = System.getProperty("browser");
19+
public static final String TIME_ZONE = "Asia/Kolkata";
1920

2021
public static final int SCREEN_WIDTH = 1920;
2122
public static final int SCREEN_HEIGHT = 1080;

0 commit comments

Comments
 (0)