forked from DevExpress/testcafe
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix 'incorrect screenshot path in report output ' (close DevExpress#2726
- Loading branch information
1 parent
462606c
commit 4894b50
Showing
9 changed files
with
59 additions
and
48 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
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,12 +1,11 @@ | ||
import { KEY_MAPS } from '../deps/testcafe-core'; | ||
import isLetter from './is-letter'; | ||
|
||
|
||
export default function (char) { | ||
if (isLetter(char)) | ||
return char.toUpperCase().charCodeAt(0); | ||
|
||
var res = KEY_MAPS.shiftMap[char] ? KEY_MAPS.shiftMap[char].charCodeAt(0) : char.charCodeAt(0); | ||
const res = KEY_MAPS.shiftMap[char] ? KEY_MAPS.shiftMap[char].charCodeAt(0) : char.charCodeAt(0); | ||
|
||
return KEY_MAPS.symbolCharCodeToKeyCode[res] || res; | ||
} |
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import hammerhead from '../deps/hammerhead'; | ||
|
||
var Promise = hammerhead.Promise; | ||
var nativeMethods = hammerhead.nativeMethods; | ||
|
||
const Promise = hammerhead.Promise; | ||
const nativeMethods = hammerhead.nativeMethods; | ||
|
||
export default function () { | ||
return new Promise(resolve => nativeMethods.setTimeout.call(window, resolve, 0)); | ||
} | ||
|
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,23 @@ | ||
import path from 'path'; | ||
|
||
export default function (paths) { | ||
if (!paths) | ||
return null; | ||
|
||
if (paths.length === 1) | ||
return paths[0]; | ||
|
||
const pathArrs = paths.map(item => item.split(path.sep)); | ||
const isCommonPathFragment = (pathFragment, idx) => pathArrs.every(pathArray => pathArray[idx] === pathFragment); | ||
let commonPathFramgemtnIndex = 0; | ||
|
||
while (isCommonPathFragment(pathArrs[0][commonPathFramgemtnIndex], commonPathFramgemtnIndex)) | ||
commonPathFramgemtnIndex++; | ||
|
||
if (!commonPathFramgemtnIndex) | ||
return null; | ||
|
||
const commonPathFragments = pathArrs[0].slice(0, commonPathFramgemtnIndex); | ||
|
||
return path.join(...commonPathFragments); | ||
} |
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