Skip to content

Instantly share code, notes, and snippets.

@Hoxolotl
Last active November 1, 2024 10:19
Show Gist options
  • Select an option

  • Save Hoxolotl/4456161e8ed75f2efe4d594913498b77 to your computer and use it in GitHub Desktop.

Select an option

Save Hoxolotl/4456161e8ed75f2efe4d594913498b77 to your computer and use it in GitHub Desktop.
Selenium ECONNREFUSED
import { Builder, By, Key, until, Browser } from 'selenium-webdriver';
import tap from "tap";
import Chrome from 'selenium-webdriver/chrome.js';
async function firstTest() {
let driver;
const screen = {
width: 1024,
height: 786
};
driver = new Builder()
.forBrowser(Browser.CHROME)
//.setChromeOptions(new Chrome.Options().addArguments('--headless').windowSize(screen))
.build();
await driver.get('http://localhost:4500');
tap.test("Website online", async t => {
//Check website online
let title = await driver.getTitle();
t.equal("SLO Curriculum Browser", title); // ok 1 - should be equal
let title2 = await driver.getTitle();
t.equal("SLO Curriculum Browser", title2); // not ok 2 - ECONNREFUSED connect ECONNREFUSED 127.0.0.1:53880
}
firstTest().then(await driver.quit());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment