Skip to content

Commit 5f85ef5

Browse files
authored
Update CSS selector for base repository on gitlab.com (#185)
1 parent e88e4ec commit 5f85ef5

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

.gitpod.yml

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ image:
44
tasks:
55
- name: install node version
66
init: |
7+
sudo apt update
8+
sudo apt install -y nodejs
79
nvm install 20
810
nvm use 20
911
nvm uninstall 16

src/button/button-contributions.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ export const buttonContributions: ButtonContributionParams[] = [
191191
],
192192
// must not match /blob/ because that is a file
193193
match: /^(?!.*\/blob\/).*$/,
194-
selector: "#tree-holder > div > div.tree-controls > div:first-child",
194+
selector: "#tree-holder .tree-controls",
195195
containerElement: { type: "div", props: { marginLeft: "8px" } },
196196
application: "gitlab",
197197
manipulations: [

test/src/button-contributions-copy.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ export const buttonContributions: ButtonContributionParams[] = [
191191
],
192192
// must not match /blob/ because that is a file
193193
match: /^(?!.*\/blob\/).*$/,
194-
selector: "#tree-holder > div > div.tree-controls > div:first-child",
194+
selector: "#tree-holder .tree-controls",
195195
containerElement: { type: "div", props: { marginLeft: "8px" } },
196196
application: "gitlab",
197197
manipulations: [

test/src/button-contributions.spec.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ describe("Platform match tests", function () {
1010

1111
before(async function () {
1212
browser = await puppeteer.launch({
13-
headless: "new",
14-
product: "chrome",
13+
headless: true,
14+
browser: "chrome",
1515
});
1616
page = await browser.newPage();
1717
});
@@ -66,8 +66,8 @@ describe("Query Selector Tests", function () {
6666

6767
before(async function () {
6868
browser = await puppeteer.launch({
69-
headless: "new",
70-
product: "chrome",
69+
headless: true,
70+
browser: "chrome",
7171
});
7272
page = await browser.newPage();
7373
});
@@ -78,7 +78,7 @@ describe("Query Selector Tests", function () {
7878

7979
async function resolveSelector(page: Page, selector: string) {
8080
if (selector.startsWith("xpath:")) {
81-
return (await page.$x(selector.slice(6)))[0] || null;
81+
return (await (page as any).$x(selector.slice(6)))[0] || null;
8282
} else {
8383
return page.$(selector);
8484
}

0 commit comments

Comments
 (0)