Skip to content
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

Playwright support #8

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/sampleworkflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Trigger playwright automation Workflow

on:
pull_request:
branches:
- main # Replace with the branch name to monitor

jobs:
trigger:
runs-on: ubuntu-latest

steps:
- name: Trigger Repository A Workflow
run: |
curl -X POST \
-H "Accept: application/vnd.github.everest-preview+json" \
-H "Authorization: Bearer ${{ secrets.AUTOMATION_REPO_TOKEN }}" \
https://api.github.com/repos/codeandtheory/playwright-automation-framework/dispatches \
-d '{"event_type": "trigger-workflow"}'
2 changes: 2 additions & 0 deletions src/main/java/com/ct/framework/common/CommonUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,9 @@ public String getImageAsBase64(WebDriver driver, String screenshotName) throws E
File finalDestination = new File(destination);
FileUtils.copyFile(source, finalDestination);
byte[] imageBytes= IOUtils.toByteArray(new FileInputStream(destination));
System.out.println("Changes made to trigger workflow...");
return Base64.getEncoder().encodeToString(imageBytes);

}

public JSONArray readFileAsJSONArray(String resourceNameWithPath){
Expand Down
Loading