Skip to content

Commit

Permalink
Improve IE and Windows support
Browse files Browse the repository at this point in the history
- Disable the brokenWindowSwitch test in IE (it hangs)
- Build browser tests as ES5
- Make loader scripts and RemoteSuite configuration script IE-friendly
- Add descriptive comments to tsconfig files
- Make webpack paths more Windows-friendly
- Make execute scripts IE-compatible
- Add a mouse click listener to one of the functional test pages to
  visualize click locations
- Add a pathRe function to create platform-compatible path-based regular
  expressions

references #1043
references #1037
  • Loading branch information
jason0x43 committed Jan 20, 2020
1 parent d4847bd commit a681b7f
Show file tree
Hide file tree
Showing 21 changed files with 171 additions and 125 deletions.
62 changes: 31 additions & 31 deletions docs/api.json
Expand Up @@ -33008,7 +33008,7 @@
"sources": [
{
"fileName": "src/core/lib/RemoteSuite.ts",
"line": 317,
"line": 320,
"character": 11
}
],
Expand Down Expand Up @@ -33114,7 +33114,7 @@
"sources": [
{
"fileName": "src/core/lib/RemoteSuite.ts",
"line": 315,
"line": 318,
"character": 11
}
],
Expand All @@ -33139,7 +33139,7 @@
"sources": [
{
"fileName": "src/core/lib/RemoteSuite.ts",
"line": 316,
"line": 319,
"character": 11
}
],
Expand Down Expand Up @@ -33193,7 +33193,7 @@
"sources": [
{
"fileName": "src/core/lib/RemoteSuite.ts",
"line": 318,
"line": 321,
"character": 12
}
],
Expand Down Expand Up @@ -33495,7 +33495,7 @@
"sources": [
{
"fileName": "src/core/lib/RemoteSuite.ts",
"line": 314,
"line": 317,
"character": 29
}
],
Expand Down Expand Up @@ -33726,7 +33726,7 @@
"sources": [
{
"fileName": "src/core/lib/RemoteSuite.ts",
"line": 311,
"line": 314,
"character": 14
}
],
Expand Down Expand Up @@ -34202,7 +34202,7 @@
"sources": [
{
"fileName": "src/core/lib/RemoteSuite.ts",
"line": 310,
"line": 313,
"character": 29
}
],
Expand Down Expand Up @@ -156381,7 +156381,7 @@
"sources": [
{
"fileName": "src/webdriver/Server.ts",
"line": 1861,
"line": 1865,
"character": 15
}
]
Expand Down Expand Up @@ -156531,7 +156531,7 @@
"sources": [
{
"fileName": "src/webdriver/Server.ts",
"line": 1854,
"line": 1858,
"character": 24
}
]
Expand Down Expand Up @@ -156574,7 +156574,7 @@
"sources": [
{
"fileName": "src/webdriver/Server.ts",
"line": 1828,
"line": 1832,
"character": 13
}
]
Expand Down Expand Up @@ -156774,7 +156774,7 @@
"sources": [
{
"fileName": "src/webdriver/Server.ts",
"line": 2028,
"line": 2032,
"character": 6
}
],
Expand All @@ -156792,7 +156792,7 @@
"sources": [
{
"fileName": "src/webdriver/Server.ts",
"line": 2027,
"line": 2031,
"character": 10
}
],
Expand All @@ -156816,7 +156816,7 @@
"sources": [
{
"fileName": "src/webdriver/Server.ts",
"line": 2026,
"line": 2030,
"character": 22
}
]
Expand Down Expand Up @@ -156859,7 +156859,7 @@
"sources": [
{
"fileName": "src/webdriver/Server.ts",
"line": 1866,
"line": 1870,
"character": 51
}
],
Expand All @@ -156881,7 +156881,7 @@
"sources": [
{
"fileName": "src/webdriver/Server.ts",
"line": 1866,
"line": 1870,
"character": 60
}
],
Expand All @@ -156903,7 +156903,7 @@
"sources": [
{
"fileName": "src/webdriver/Server.ts",
"line": 1866,
"line": 1870,
"character": 52
}
]
Expand All @@ -156919,7 +156919,7 @@
"sources": [
{
"fileName": "src/webdriver/Server.ts",
"line": 1866,
"line": 1870,
"character": 35
}
],
Expand All @@ -156942,7 +156942,7 @@
"sources": [
{
"fileName": "src/webdriver/Server.ts",
"line": 1866,
"line": 1870,
"character": 28
}
]
Expand All @@ -156959,7 +156959,7 @@
"sources": [
{
"fileName": "src/webdriver/Server.ts",
"line": 1866,
"line": 1870,
"character": 21
}
]
Expand Down Expand Up @@ -157000,7 +157000,7 @@
"sources": [
{
"fileName": "src/webdriver/Server.ts",
"line": 1894,
"line": 1898,
"character": 18
}
]
Expand Down Expand Up @@ -157041,7 +157041,7 @@
"sources": [
{
"fileName": "src/webdriver/Server.ts",
"line": 1899,
"line": 1903,
"character": 26
}
]
Expand Down Expand Up @@ -157126,7 +157126,7 @@
"sources": [
{
"fileName": "src/webdriver/Server.ts",
"line": 1904,
"line": 1908,
"character": 17
}
]
Expand Down Expand Up @@ -157213,7 +157213,7 @@
"sources": [
{
"fileName": "src/webdriver/Server.ts",
"line": 1969,
"line": 1973,
"character": 25
}
]
Expand Down Expand Up @@ -157300,7 +157300,7 @@
"sources": [
{
"fileName": "src/webdriver/Server.ts",
"line": 1943,
"line": 1947,
"character": 34
}
]
Expand Down Expand Up @@ -157341,7 +157341,7 @@
"sources": [
{
"fileName": "src/webdriver/Server.ts",
"line": 1916,
"line": 1920,
"character": 14
}
]
Expand Down Expand Up @@ -157427,7 +157427,7 @@
"sources": [
{
"fileName": "src/webdriver/Server.ts",
"line": 1921,
"line": 1925,
"character": 14
}
]
Expand Down Expand Up @@ -157514,7 +157514,7 @@
"sources": [
{
"fileName": "src/webdriver/Server.ts",
"line": 1930,
"line": 1934,
"character": 24
}
]
Expand Down Expand Up @@ -157601,7 +157601,7 @@
"sources": [
{
"fileName": "src/webdriver/Server.ts",
"line": 1956,
"line": 1960,
"character": 24
}
]
Expand Down Expand Up @@ -157689,7 +157689,7 @@
"sources": [
{
"fileName": "src/webdriver/Server.ts",
"line": 1987,
"line": 1991,
"character": 23
}
]
Expand All @@ -157716,7 +157716,7 @@
"sources": [
{
"fileName": "src/webdriver/Server.ts",
"line": 2012,
"line": 2016,
"character": 13
}
]
Expand Down Expand Up @@ -157763,7 +157763,7 @@
"sources": [
{
"fileName": "src/webdriver/Server.ts",
"line": 2022,
"line": 2026,
"character": 20
}
]
Expand Down
2 changes: 1 addition & 1 deletion intern.json
Expand Up @@ -62,7 +62,7 @@
"options": { "hideSkipped": false, "hidePassed": false }
},

"tsconfig": "tsconfig-tests.json"
"tsconfig": "tsconfig.json"
},

"browser": {
Expand Down
5 changes: 4 additions & 1 deletion src/core/lib/RemoteSuite.ts
Expand Up @@ -273,10 +273,13 @@ export default class RemoteSuite extends Suite {
// Send the config data in an execute block to avoid sending
// very large query strings
.execute(
// This script should be IE11-compatible
/* istanbul ignore next */ function(configString: string) {
const options = JSON.parse(configString);
intern.configure(options);
intern.run().catch(() => undefined);
intern.run().catch(function() {
return undefined;
});
},
[stringify(remoteConfig)]
)
Expand Down
7 changes: 4 additions & 3 deletions src/core/loaders/default.ts
@@ -1,12 +1,13 @@
/**
* A loader script for loading non-module JavaScript suites.
*
* Note that loader scripts must be simple scripts, not modules.
* Note that loader scripts must be simple scripts, not modules, and must use
* IE11 compatible code (no arrow functions).
*/
intern.registerLoader(() => {
intern.registerLoader(function() {
intern.log('Using default loader');

return (modules: string[]) => {
return function(modules: string[]) {
return intern.loadScript(modules);
};
});
19 changes: 10 additions & 9 deletions src/core/loaders/dojo.ts
@@ -1,9 +1,10 @@
/**
* A loader script for setting up the Dojo loader.
*
* Note that loader scripts must be simple scripts, not modules.
* Note that loader scripts must be simple scripts, not modules, and must use
* IE11 compatible code (no arrow functions).
*/
intern.registerLoader(options => {
intern.registerLoader(function(options) {
const globalObj: any = typeof window !== 'undefined' ? window : global;

options.baseUrl = options.baseUrl || intern.config.basePath;
Expand All @@ -19,28 +20,28 @@ intern.registerLoader(options => {
intern.log('Configuring Dojo loader with:', options);
globalObj.dojoConfig = options;

return intern.loadScript('node_modules/dojo/dojo.js').then(() => {
return intern.loadScript('node_modules/dojo/dojo.js').then(function() {
const require = globalObj.require;
intern.log('Using Dojo loader');

return (modules: string[]) => {
return function(modules: string[]) {
let handle: { remove(): void };

return new Promise((resolve, reject) => {
handle = require.on('error', (error: Error) => {
return new Promise(function(resolve, reject) {
handle = require.on('error', function(error: Error) {
intern.emit('error', error);
reject(new Error(`Dojo loader error: ${error.message}`));
});

intern.log('Loading modules:', modules);
require(modules, () => {
require(modules, function() {
resolve();
});
}).then<void>(
() => {
function() {
handle.remove();
},
error => {
function(error) {
handle && handle.remove();
throw error;
}
Expand Down

0 comments on commit a681b7f

Please sign in to comment.