Skip to content

Commit b247c06

Browse files
authored
Run test suite when PR is created against develop branch. (#179)
1 parent 17cb2e4 commit b247c06

3 files changed

Lines changed: 17 additions & 3 deletions

File tree

.github/workflows/tests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ on:
77
# Terraform workflow (workflow_run on success), then the test-site deploy.
88
push:
99
branches: [ master, develop ]
10+
# Run on PRs targeting master or develop (branches = the PR's base branch).
1011
pull_request:
11-
branches: [ master ]
12+
branches: [ master, develop ]
1213
workflow_dispatch:
1314
permissions:
1415
contents: read

tests/jwt_tools.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,13 @@ async function getAccessToken(driver, client_id, client_secret, scope, pkce_enab
8989
var redirect_uri = By.id("redirect_uri");
9090
await driver.findElement(redirect_uri).clear();
9191
await driver.findElement(redirect_uri).sendKeys(baseUrl + "/callback");
92-
await driver.findElement(btn_authorize).click();
92+
// Scroll into view and JS-click: a native .click() can fail with "element
93+
// click intercepted" because a hidden ".tooltiptext" span still occupies
94+
// layout over the button. A JS click bypasses that interception check.
95+
var btn_authorize_el = await driver.findElement(btn_authorize);
96+
await driver.executeScript(
97+
"arguments[0].scrollIntoView({ block: 'center' }); arguments[0].click();",
98+
btn_authorize_el);
9399

94100
// Login to Keycloak
95101
try {

tests/oauth2_device_authorization.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,14 @@ async function requestDeviceAuthorization(driver, client_id, scope) {
5757
await driver.findElement(scopeField).sendKeys(scope);
5858

5959
const authorizeBtn = By.css('input[type="submit"][value="Authorize"]');
60-
await driver.findElement(authorizeBtn).click();
60+
// Scroll into view and click via JS. A native .click() runs ChromeDriver's
61+
// interception check, which fails here because a hidden ".tooltiptext" span
62+
// still occupies layout over the button ("element click intercepted"). A JS
63+
// click invokes the handler directly and bypasses that check.
64+
const authorizeEl = await driver.findElement(authorizeBtn);
65+
await driver.executeScript(
66+
"arguments[0].scrollIntoView({ block: 'center' }); arguments[0].click();",
67+
authorizeEl);
6168

6269
// The device authorization response is shown on debugger2.html.
6370
await driver.wait(until.elementLocated(By.id("device_user_code")), waitTime);

0 commit comments

Comments
 (0)