- name: Run tests
run: npm run ${{ matrix.NPM_SCRIPT }}
+ ie:
+ runs-on: windows-latest
+ env:
+ NODE_VERSION: 20.x
+ name: test:ie - IE
+ steps:
+ - name: Checkout
+ uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+
+ - name: Use Node.js ${{ env.NODE_VERSION }}
+ uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
+ with:
+ node-version: ${{ env.NODE_VERSION }}
+
+ - name: Cache
+ uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
+ with:
+ path: ~/.npm
+ key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
+ restore-keys: |
+ ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-
+
+ - name: Install dependencies
+ run: npm install
+
+ - name: Run tests in Edge in IE mode
+ run: npm run test:ie
+
safari:
runs-on: macos-latest
env:
"test:jsdom": "npm run pretest && npm run build:main && npm run test:unit -- -b jsdom -m basic",
"test:node_smoke_tests": "npm run pretest && npm run build:all && node build/tasks/node_smoke_tests.js",
"test:promises_aplus": "npm run build:main && node build/tasks/promises_aplus_tests.js",
+ "test:chrome": "npm run pretest && npm run build:main && npm run test:unit -- -v -b chrome -h",
+ "test:edge": "npm run pretest && npm run build:main && npm run test:unit -- -v -b edge -h",
"test:firefox": "npm run pretest && npm run build:main && npm run test:unit -- -v -b firefox -h",
+ "test:ie": "npm run pretest && npm run build:main && npm run test:unit -- -v -b ie",
"test:safari": "npm run pretest && npm run build:main && npm run test:unit -- -b safari",
"test:server": "node test/runner/server.js",
"test:esm": "npm run pretest && npm run build:main && npm run test:unit -- --esm -h",
import Chrome from "selenium-webdriver/chrome.js";
import Edge from "selenium-webdriver/edge.js";
import Firefox from "selenium-webdriver/firefox.js";
+import IE from "selenium-webdriver/ie.js";
import { browserSupportsHeadless } from "../lib/getBrowserString.js";
// Set script timeout to 10min
export default async function createDriver( { browserName, headless, url, verbose } ) {
const capabilities = Capabilities[ browserName ]();
- const prefs = new logging.Preferences();
- prefs.setLevel( logging.Type.BROWSER, logging.Level.ALL );
- capabilities.setLoggingPrefs( prefs );
+
+ // Support: IE 11+
+ // When those are set for IE, the process crashes with an error:
+ // "Unable to match capability set 0: goog:loggingPrefs is an unknown
+ // extension capability for IE".
+ if ( browserName !== "ie" ) {
+ const prefs = new logging.Preferences();
+ prefs.setLevel( logging.Type.BROWSER, logging.Level.ALL );
+ capabilities.setLoggingPrefs( prefs );
+ }
let driver = new Builder().withCapabilities( capabilities );
edgeOptions.setEdgeChromiumBinaryPath( process.env.EDGE_BIN );
}
+ const ieOptions = new IE.Options();
+ ieOptions.setEdgeChromium( true );
+ ieOptions.setEdgePath( "C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe" );
+
if ( headless ) {
chromeOptions.addArguments( "--headless=new" );
firefoxOptions.addArguments( "--headless" );
.setChromeOptions( chromeOptions )
.setFirefoxOptions( firefoxOptions )
.setEdgeOptions( edgeOptions )
+ .setIeOptions( ieOptions )
.build();
if ( verbose ) {