Skip to content

Commit

Permalink
Hide cursor when a browser manipulation is in execution (closes DevEx…
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderMoskovkin committed Feb 22, 2017
1 parent 96bf9c4 commit a436fb2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/client/automation/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import AutomationSettings from './settings';
import { getOffsetOptions } from './utils/offsets';
import calculateSelectTextArguments from './playback/select/calculate-select-text-arguments';
import ERROR_TYPES from './errors';
import cursor from './cursor';


exports.Click = ClickAutomation;
Expand All @@ -40,6 +41,7 @@ exports.ERROR_TYPES = ERROR_TYPES;
exports.AutomationSettings = AutomationSettings;
exports.getOffsetOptions = getOffsetOptions;
exports.calculateSelectTextArguments = calculateSelectTextArguments;
exports.cursor = cursor;

exports.get = require;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import hammerhead from '../deps/hammerhead';
import testCafeCore from '../deps/testcafe-core';
import { cursor } from '../deps/testcafe-automation';
import MESSAGE from '../../../test-run/client-messages';
import DriverStatus from '../status';

Expand Down Expand Up @@ -30,6 +31,11 @@ export default function prepareBrowserManipulation (browserId) {

document.title = assignedTitle;

var isCursorVisible = cursor.visible;

if (isCursorVisible)
cursor.hide();

return delay(APPLY_DOCUMENT_TITLE_TIMEOUT)
.then(() => {
var message = {
Expand All @@ -46,6 +52,9 @@ export default function prepareBrowserManipulation (browserId) {
nativeMethods.clearInterval.call(window, checkTitleIntervalId);
document.title = savedDocumentTitle;

if (isCursorVisible)
cursor.show();

return delay(RESTORE_DOCUMENT_TITLE_TIMEOUT);
})
.then(() => new DriverStatus({ isCommandResult: true, result }));
Expand Down

0 comments on commit a436fb2

Please sign in to comment.