Skip to content

Commit

Permalink
More mouseMoveTo updates
Browse files Browse the repository at this point in the history
Relax the test in IE
  • Loading branch information
jason0x43 committed Jan 4, 2021
1 parent 0049587 commit ad9ed82
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions tests/functional/Session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { strategies } from '../../src/lib/Locator';
import Element from '../../src/Element';
import { WebDriverCookie, Geolocation } from '../../src/interfaces';
import Session from '../../src/Session';
import { isInternetExplorer } from '../../src/Server';
import { Task } from '@theintern/common';
import Test, { TestFunction } from 'intern/lib/Test';
import Suite from 'intern/lib/Suite';
Expand Down Expand Up @@ -1738,7 +1739,7 @@ registerSuite('Session', () => {
return session
.get('tests/functional/data/pointer.html')
.then(function() {
return session.moveMouseTo(110, 12);
return session.moveMouseTo(100, 12);
})
.then(function() {
return session.execute(
Expand All @@ -1747,8 +1748,19 @@ registerSuite('Session', () => {
})
.then(function(event: MouseEvent) {
assert.isObject(event);
assert.strictEqual(event.clientX, 110);
assert.strictEqual(event.clientY, 12);

if (isInternetExplorer(session.capabilities)) {
assert.closeTo(event.clientX, 100, 10);
} else {
assert.strictEqual(event.clientX, 100);
}

if (isInternetExplorer(session.capabilities)) {
assert.closeTo(event.clientY, 12, 10);
} else {
assert.strictEqual(event.clientY, 12);
}

return session.moveMouseTo(100, 41);
})
.then(function() {
Expand All @@ -1758,7 +1770,7 @@ registerSuite('Session', () => {
})
.then(function(event: MouseEvent) {
assert.isObject(event);
assert.strictEqual(event.clientX, 210);
assert.strictEqual(event.clientX, 200);
assert.strictEqual(event.clientY, 53);
return session.findById('c');
})
Expand Down

0 comments on commit ad9ed82

Please sign in to comment.