@applitools/eyes-testcafe 2.0.0-beta.9 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +467 -0
- package/LICENSE +1 -1
- package/README.md +7 -531
- package/dist/api.js +51 -0
- package/dist/extract-environment.js +15 -0
- package/dist/index-legacy.js +5 -0
- package/dist/index.js +19 -0
- package/dist/legacy.js +225 -0
- package/dist/spec-driver.js +245 -0
- package/package.json +73 -77
- package/types/index-legacy.d.ts +2 -0
- package/types/index.d.ts +1833 -0
- package/dist/captureFrameAndPoll.js +0 -1468
- package/dist/captureFrameAndPollForIE.js +0 -12569
- package/index.js +0 -30
- package/lib/BordersAwareElementContentLocationProvider.js +0 -79
- package/lib/Eyes.js +0 -927
- package/lib/EyesFactory.js +0 -73
- package/lib/EyesTestCafe.js +0 -1277
- package/lib/EyesTestcafeUtils.js +0 -440
- package/lib/EyesVisualGrid.js +0 -345
- package/lib/ImageOrientationHandler.js +0 -31
- package/lib/JavascriptHandler.js +0 -20
- package/lib/TestCafeExecutor.js +0 -57
- package/lib/capture/EyesWebDriverScreenshot.js +0 -650
- package/lib/capture/EyesWebDriverScreenshotFactory.js +0 -32
- package/lib/capture/FirefoxScreenshotImageProvider.js +0 -63
- package/lib/capture/ImageProviderFactory.js +0 -38
- package/lib/capture/SafariScreenshotImageProvider.js +0 -254
- package/lib/capture/TakesScreenshotImageProvider.js +0 -35
- package/lib/errors/EyesDriverOperationError.js +0 -10
- package/lib/errors/NoFramesError.js +0 -7
- package/lib/fluent/AccessibilityRegionByElement.js +0 -46
- package/lib/fluent/AccessibilityRegionBySelector.js +0 -58
- package/lib/fluent/FloatingRegionByElement.js +0 -56
- package/lib/fluent/FloatingRegionBySelector.js +0 -63
- package/lib/fluent/FrameLocator.js +0 -110
- package/lib/fluent/IgnoreRegionByElement.js +0 -51
- package/lib/fluent/IgnoreRegionBySelector.js +0 -57
- package/lib/fluent/SelectorByElement.js +0 -37
- package/lib/fluent/SelectorByLocator.js +0 -47
- package/lib/fluent/Target.js +0 -17
- package/lib/fluent/TestcafeCheckSettings.js +0 -352
- package/lib/frames/Frame.js +0 -149
- package/lib/frames/FrameChain.js +0 -175
- package/lib/getCaptureDomScript.js +0 -14
- package/lib/hash.js +0 -15
- package/lib/isTestcafeSelector.js +0 -7
- package/lib/makeClientFunctionWrapper.js +0 -61
- package/lib/positioning/CssTranslatePositionMemento.js +0 -39
- package/lib/positioning/CssTranslatePositionProvider.js +0 -130
- package/lib/positioning/ElementPositionMemento.js +0 -36
- package/lib/positioning/ElementPositionProvider.js +0 -88
- package/lib/positioning/FirefoxRegionPositionCompensation.js +0 -45
- package/lib/positioning/ImageRotation.js +0 -22
- package/lib/positioning/OverflowAwareCssTranslatePositionProvider.js +0 -17
- package/lib/positioning/OverflowAwareScrollPositionProvider.js +0 -17
- package/lib/positioning/RegionPositionCompensationFactory.js +0 -37
- package/lib/positioning/SafariRegionPositionCompensation.js +0 -26
- package/lib/positioning/ScrollPositionMemento.js +0 -36
- package/lib/positioning/ScrollPositionProvider.js +0 -118
- package/lib/positioning/fixImageMarkPosition.js +0 -36
- package/lib/regionVisibility/MoveToRegionVisibilityStrategy.js +0 -55
- package/lib/regionVisibility/NopRegionVisibilityStrategy.js +0 -35
- package/lib/regionVisibility/RegionVisibilityStrategy.js +0 -30
- package/lib/runner/ClassicRunner.js +0 -49
- package/lib/runner/EyesRunner.js +0 -41
- package/lib/runner/TestResultContainer.js +0 -38
- package/lib/runner/TestResultsSummary.js +0 -112
- package/lib/runner/VisualGridRunner.js +0 -57
- package/lib/safeExecuteFunction.js +0 -28
- package/lib/wrappers/EyesTargetLocator.js +0 -335
- package/lib/wrappers/EyesWebDriver.js +0 -571
- package/lib/wrappers/EyesWebElement.js +0 -383
- package/lib/wrappers/EyesWebElementPromise.js +0 -68
package/index.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const core = require('@applitools/eyes-sdk-core')
|
|
4
|
-
|
|
5
|
-
exports.Target = require('./lib/fluent/Target').Target
|
|
6
|
-
exports.Eyes = require('./lib/EyesTestCafe').EyesTestCafe
|
|
7
|
-
|
|
8
|
-
// eyes-sdk-core
|
|
9
|
-
exports.RectangleSize = core.RectangleSize
|
|
10
|
-
exports.AccessibilityLevel = core.AccessibilityLevel
|
|
11
|
-
exports.AccessibilityMatchSettings = core.AccessibilityMatchSettings
|
|
12
|
-
exports.BatchInfo = core.BatchInfo
|
|
13
|
-
exports.Configuration = core.Configuration
|
|
14
|
-
exports.ExactMatchSettings = core.ExactMatchSettings
|
|
15
|
-
exports.FloatingMatchSettings = core.FloatingMatchSettings
|
|
16
|
-
exports.ImageMatchSettings = core.ImageMatchSettings
|
|
17
|
-
exports.MatchLevel = core.MatchLevel
|
|
18
|
-
exports.ProxySettings = core.ProxySettings
|
|
19
|
-
exports.StitchMode = core.StitchMode
|
|
20
|
-
exports.EyesError = core.EyesError
|
|
21
|
-
exports.ConsoleLogHandler = core.ConsoleLogHandler
|
|
22
|
-
exports.DebugLogHandler = core.DebugLogHandler
|
|
23
|
-
exports.FileDebugScreenshotsProvider = core.FileDebugScreenshotsProvider
|
|
24
|
-
exports.FileLogHandler = core.FileLogHandler
|
|
25
|
-
exports.EyesJsBrowserUtils = core.EyesJsBrowserUtils
|
|
26
|
-
exports.DiffsFoundError = core.DiffsFoundError
|
|
27
|
-
exports.NewTestError = core.NewTestError
|
|
28
|
-
exports.TestFailedError = core.TestFailedError
|
|
29
|
-
exports.TestResults = core.TestResults
|
|
30
|
-
exports.TestResultsStatus = core.TestResultsStatus
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const {ArgumentGuard, Location} = require('@applitools/eyes-common')
|
|
4
|
-
|
|
5
|
-
const {EyesWebElement} = require('./wrappers/EyesWebElement')
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @private
|
|
9
|
-
* @param {Logger} logger
|
|
10
|
-
* @param {EyesWebElement} element
|
|
11
|
-
* @param {string} propName
|
|
12
|
-
* @return {Promise<number>}
|
|
13
|
-
*/
|
|
14
|
-
async function getPropertyValue(logger, element, propName) {
|
|
15
|
-
logger.verbose(`Get element's ${propName}...`)
|
|
16
|
-
|
|
17
|
-
let styleResult
|
|
18
|
-
try {
|
|
19
|
-
if (element instanceof EyesWebElement) {
|
|
20
|
-
logger.verbose("Element is an EyesWebElement, using 'getComputedStyle'.")
|
|
21
|
-
try {
|
|
22
|
-
styleResult = await element.getComputedStyle(propName)
|
|
23
|
-
logger.verbose('Done!')
|
|
24
|
-
} catch (err) {
|
|
25
|
-
logger.verbose(`Using getComputedStyle failed: ${err}`)
|
|
26
|
-
logger.verbose('Using getCssValue...')
|
|
27
|
-
styleResult = await element.getCssValue(propName)
|
|
28
|
-
}
|
|
29
|
-
} else {
|
|
30
|
-
// OK, this is weird, we got an element which is not EyesWebElement?? Log it and try to move on.
|
|
31
|
-
logger.log(
|
|
32
|
-
`Element is not an EyesWebElement! (when trying to get ${propName}) Element's class: ${element.constructor.name}`,
|
|
33
|
-
)
|
|
34
|
-
logger.verbose('Using getCssValue...')
|
|
35
|
-
styleResult = await element.getCssValue(propName)
|
|
36
|
-
logger.verbose('Done!')
|
|
37
|
-
}
|
|
38
|
-
} catch (err) {
|
|
39
|
-
logger.verbose(`Couldn't get the element's ${propName}: ${err}. Falling back to default`)
|
|
40
|
-
styleResult = 0
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// Convert value from the format "2px" to int.
|
|
44
|
-
const borderWidth = Math.round(Number(styleResult.trim().replace('px', '')))
|
|
45
|
-
logger.verbose(`${propName}: ${borderWidth}`)
|
|
46
|
-
return borderWidth
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Encapsulates an algorithm to find an element's content location, based on the element's location.
|
|
51
|
-
*
|
|
52
|
-
* @ignore
|
|
53
|
-
*/
|
|
54
|
-
class BordersAwareElementContentLocationProvider {
|
|
55
|
-
/**
|
|
56
|
-
* Returns a location based on the given location.
|
|
57
|
-
*
|
|
58
|
-
* @param {Logger} logger - The logger to use.
|
|
59
|
-
* @param {EyesWebElement} element - The element for which we want to find the content's location.
|
|
60
|
-
* @param {Location} location - The location of the element.
|
|
61
|
-
* @return {Promise<Location>} - The location of the content of the element.
|
|
62
|
-
*/
|
|
63
|
-
static async getLocation(logger, element, location) {
|
|
64
|
-
ArgumentGuard.notNull(logger, 'logger')
|
|
65
|
-
ArgumentGuard.notNull(element, 'element')
|
|
66
|
-
ArgumentGuard.notNull(location, 'location')
|
|
67
|
-
|
|
68
|
-
logger.verbose(`BordersAdditionFrameLocationProvider(logger, element, ${location})`)
|
|
69
|
-
|
|
70
|
-
// Frame borders also have effect on the frame's location.
|
|
71
|
-
const leftBorderWidth = await getPropertyValue(logger, element, 'border-left-width')
|
|
72
|
-
const topBorderWidth = await getPropertyValue(logger, element, 'border-top-width')
|
|
73
|
-
const contentLocation = new Location(location).offset(leftBorderWidth, topBorderWidth)
|
|
74
|
-
logger.verbose('Done!')
|
|
75
|
-
return contentLocation
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
exports.BordersAwareElementContentLocationProvider = BordersAwareElementContentLocationProvider
|