Skip to content

Commit 0545cbe

Browse files
DavertMikclaude
andcommitted
fix: final review wave — CI checksum on cache hits, workflow permissions, docs corrections, scroll-into-view clicks
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent cf288ce commit 0545cbe

7 files changed

Lines changed: 26 additions & 16 deletions

File tree

.github/workflows/obscura.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ concurrency:
1212
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
1313
cancel-in-progress: true
1414

15+
permissions:
16+
contents: read
17+
1518
env:
1619
CI: true
1720
FORCE_COLOR: 1
@@ -29,6 +32,8 @@ jobs:
2932

3033
steps:
3134
- uses: actions/checkout@v6
35+
with:
36+
persist-credentials: false
3237
- name: Use Node.js ${{ matrix.node-version }}
3338
uses: actions/setup-node@v6
3439
with:
@@ -38,19 +43,19 @@ jobs:
3843
php-version: 8.0
3944
- name: npm install
4045
run: npm i --force
41-
- name: Cache Obscura binary
46+
- name: Cache Obscura tarball
4247
uses: actions/cache@v4
4348
with:
44-
path: ~/obscura-bin
49+
path: ~/obscura-bin/obscura.tar.gz
4550
key: obscura-${{ env.OBSCURA_VERSION }}-x86_64-linux
4651
- name: Download Obscura
4752
run: |
48-
if [ ! -f ~/obscura-bin/obscura ]; then
49-
mkdir -p ~/obscura-bin
50-
curl -sL -o /tmp/obscura.tar.gz https://github.com/h4ckf0r0day/obscura/releases/download/${OBSCURA_VERSION}/obscura-x86_64-linux.tar.gz
51-
echo "${OBSCURA_SHA256} /tmp/obscura.tar.gz" | sha256sum -c -
52-
tar xzf /tmp/obscura.tar.gz -C ~/obscura-bin
53+
mkdir -p ~/obscura-bin
54+
if [ ! -f ~/obscura-bin/obscura.tar.gz ]; then
55+
curl -sfL -o ~/obscura-bin/obscura.tar.gz https://github.com/h4ckf0r0day/obscura/releases/download/${OBSCURA_VERSION}/obscura-x86_64-linux.tar.gz
5356
fi
57+
echo "${OBSCURA_SHA256} $HOME/obscura-bin/obscura.tar.gz" | sha256sum -c -
58+
tar xzf ~/obscura-bin/obscura.tar.gz -C ~/obscura-bin
5459
~/obscura-bin/obscura --version
5560
- name: start test server and obscura
5661
run: |

docs/alternative-browsers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ headless Chromium.
6161

6262
## When to stay with Playwright
6363

64-
- Anything visual: screenshots, visual regression, PDF (Obscura cannot; Kitesurf can).
64+
- Anything visual: screenshots, visual regression, PDF (neither helper exposes PDF output).
6565
- Visibility semantics: on Obscura every element reports as visible — `seeElement`/`dontSeeElement`
6666
throw and point you to `seeElementInDOM`.
6767
- Complex input: drag-and-drop, hover chains, file uploads, iframes, multi-tab, service workers.

docs/helpers/CDPBrowser.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ I.checkOption('agree', '//form');
267267
#### Parameters
268268

269269
* `field` **([string][1] | [object][3])** checkbox located by label | name | CSS | XPath | strict locator.
270-
* `context` **([string][1]? | [object][3])** (optional, `null` by default) element located by CSS | XPath | strict locator.
270+
* `context` **([string][1]? | [object][3])** (optional, `null` by default) element located by CSS | XPath | strict locator (currently ignored by this helper).
271271

272272
Returns **[Promise][4]<void>**&#x20;
273273

@@ -332,7 +332,7 @@ I.click({css: 'nav a.login'});
332332
#### Parameters
333333

334334
* `locator` **([string][1] | [object][3])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
335-
* `context` **([string][1]? | [object][3])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
335+
* `context` **([string][1]? | [object][3])** (optional, `null` by default) element to search in CSS|XPath|Strict locator (currently ignored by this helper).
336336

337337
<!---->
338338

@@ -481,7 +481,7 @@ I.forceClick({css: 'nav a.login'});
481481
#### Parameters
482482

483483
* `locator` **([string][1] | [object][3])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
484-
* `context` **([string][1]? | [object][3])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
484+
* `context` **([string][1]? | [object][3])** (optional, `null` by default) element to search in CSS|XPath|Strict locator (currently ignored by this helper).
485485

486486
Returns **[Promise][4]<void>**&#x20;
487487

@@ -847,7 +847,7 @@ I.uncheckOption('agree', '//form');
847847
#### Parameters
848848

849849
* `field` **([string][1] | [object][3])** checkbox located by label | name | CSS | XPath | strict locator.
850-
* `context` **([string][1]? | [object][3])** (optional, `null` by default) element located by CSS | XPath | strict locator.
850+
* `context` **([string][1]? | [object][3])** (optional, `null` by default) element located by CSS | XPath | strict locator (currently ignored by this helper).
851851

852852
Returns **[Promise][4]<void>**&#x20;
853853

docs/helpers/Obscura.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ Type: [object][2]
9999
}
100100
```
101101

102+
## Methods
103+
102104
### Parameters
103105

104106
* `config` **ObscuraConfig**&#x20;

lib/helper/CDPBrowser.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ class CDPBrowser extends Helper {
801801
* ```
802802
*
803803
* @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
804-
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
804+
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator (currently ignored by this helper).
805805
* @returns {Promise<void>}
806806
* @throws {Error} if the matched element has a zero-size bounding box.
807807
*/
@@ -844,7 +844,7 @@ class CDPBrowser extends Helper {
844844
* ```
845845
*
846846
* @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
847-
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
847+
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator (currently ignored by this helper).
848848
* @returns {Promise<void>}
849849
*/
850850
async forceClick(locator, context = null) {
@@ -959,7 +959,7 @@ class CDPBrowser extends Helper {
959959
* ```
960960
*
961961
* @param {CodeceptJS.LocatorOrString} field checkbox located by label | name | CSS | XPath | strict locator.
962-
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS | XPath | strict locator.
962+
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS | XPath | strict locator (currently ignored by this helper).
963963
* @returns {Promise<void>}
964964
*/
965965
async checkOption(field, context = null) {
@@ -978,7 +978,7 @@ class CDPBrowser extends Helper {
978978
* ```
979979
*
980980
* @param {CodeceptJS.LocatorOrString} field checkbox located by label | name | CSS | XPath | strict locator.
981-
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS | XPath | strict locator.
981+
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS | XPath | strict locator (currently ignored by this helper).
982982
* @returns {Promise<void>}
983983
*/
984984
async uncheckOption(field, context = null) {

lib/helper/Obscura.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ const config = {}
8989
* }
9090
* }
9191
* ```
92+
*
93+
* ## Methods
9294
*/
9395
class Obscura extends CDPBrowser {
9496
/**

lib/helper/clientscripts/cdpBrowserClient.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export default function installCodeceptClient() {
2929
attrs: (els, p) => els.map(el => el.getAttribute(p.name)),
3030
html: els => els.map(el => el.outerHTML),
3131
rect: els => {
32+
if (els[0].scrollIntoView) els[0].scrollIntoView({ block: 'center', inline: 'center' })
3233
const r = els[0].getBoundingClientRect()
3334
return { x: r.x, y: r.y, width: r.width, height: r.height }
3435
},

0 commit comments

Comments
 (0)