-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(findpath): do not look for symlink (#147)
On Windows, the symlink is not created if user does not have Administrator privileges. Look for actual file path instead of symlink.
- Loading branch information
1 parent
c53ab35
commit 75a9fc0
Showing
7 changed files
with
69 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,19 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "npm" | ||
directory: "/" | ||
directory: "." | ||
schedule: | ||
interval: "daily" | ||
versioning-strategy: increase | ||
groups: | ||
npm: | ||
patterns: | ||
- "*" | ||
- package-ecosystem: "github-actions" | ||
directory: ".github/workflows" | ||
schedule: | ||
interval: "daily" | ||
groups: | ||
gha: | ||
patterns: | ||
- "*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import fs from 'node:fs'; | ||
import { expect, test } from 'vitest'; | ||
|
||
import util from '../src/util.js'; | ||
|
||
test('nwjs has downloaded and been extracted', function () { | ||
util.findpath('nwjs').then(function (path) { | ||
expect(fs.existsSync(path)).toEqual(true); | ||
}) | ||
.catch((error) => { | ||
console.log(error); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,39 @@ | ||
import assert from "node:assert"; | ||
import path from "node:path"; | ||
|
||
import { By } from "selenium-webdriver"; | ||
import selenium from "selenium-webdriver"; | ||
import chrome from "selenium-webdriver/chrome.js"; | ||
import { describe, it } from "vitest"; | ||
import { afterAll, beforeAll, describe, expect, it } from "vitest"; | ||
|
||
import util from "../src/util.js"; | ||
|
||
const { Driver, ServiceBuilder, Options } = chrome; | ||
|
||
describe("run", async () => { | ||
describe("run", async function () { | ||
let driver = undefined; | ||
|
||
it("should run post install", async () => { | ||
const options = new Options(); | ||
const args = [ | ||
beforeAll(async function () { | ||
const options = new chrome.Options(); | ||
const seleniumArgs = [ | ||
`--nwapp=${path.resolve("test", "app")}`, | ||
"--headless=new", | ||
]; | ||
options.addArguments(args); | ||
|
||
const chromedriverPath = util.findpath("chromedriver"); | ||
options.addArguments(seleniumArgs); | ||
|
||
const chromedriverPath = await util.findpath("chromedriver", { flavor: 'sdk' }); | ||
const service = new chrome.ServiceBuilder(chromedriverPath).build(); | ||
|
||
driver = chrome.Driver.createSession(options, service); | ||
}); | ||
|
||
const service = new ServiceBuilder(chromedriverPath).build(); | ||
it("should run post install", async function () { | ||
const textElement = await driver.findElement(selenium.By.id('test')); | ||
|
||
driver = Driver.createSession(options, service); | ||
const text = await driver.findElement(By.id("test")).getText(); | ||
assert.strictEqual(text, "Hello, World! Is anyone out there?"); | ||
const text = await textElement.getText(); | ||
|
||
expect(text).toEqual('Hello, World! Is anyone out there?'); | ||
}, { timeout: Infinity }); | ||
|
||
afterAll(function () { | ||
driver.quit(); | ||
}); | ||
|
||
}); |