From 6b90e32fafb1369e578f024e0b0c67962673adf8 Mon Sep 17 00:00:00 2001 From: AlexanderMoskovkin Date: Wed, 4 Oct 2017 16:56:34 +0300 Subject: [PATCH] Fix tests. --- src/client/driver/driver.js | 8 ++------ src/test-run/index.js | 3 +-- test/functional/fixtures/api/es-next/roles/test.js | 2 +- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/client/driver/driver.js b/src/client/driver/driver.js index 5f86e32ffdd..a088b175038 100644 --- a/src/client/driver/driver.js +++ b/src/client/driver/driver.js @@ -206,12 +206,8 @@ export default class Driver { } _addConsoleMessagesToStatus (status) { - var messages = this.consoleMessages; - - if (messages) { - status.consoleMessages = messages; - this.consoleMessages = null; - } + status.consoleMessages = this.consoleMessages; + this.consoleMessages = null; } _sendStatus (status) { diff --git a/src/test-run/index.js b/src/test-run/index.js index 65ae406cac2..ce8a560b4e8 100644 --- a/src/test-run/index.js +++ b/src/test-run/index.js @@ -352,8 +352,7 @@ export default class TestRun extends Session { var currentTaskRejectedByError = pageError && this._handlePageErrorStatus(pageError); - if (driverStatus.consoleMessages) - this.consoleMessages.concat(driverStatus.consoleMessages); + this.consoleMessages.concat(driverStatus.consoleMessages); if (!currentTaskRejectedByError && driverStatus.isCommandResult) { if (this.currentDriverTask.command.type === COMMAND_TYPE.testDone) { diff --git a/test/functional/fixtures/api/es-next/roles/test.js b/test/functional/fixtures/api/es-next/roles/test.js index 2c6c5a9753f..f85d1f4f389 100644 --- a/test/functional/fixtures/api/es-next/roles/test.js +++ b/test/functional/fixtures/api/es-next/roles/test.js @@ -23,7 +23,7 @@ describe('[API] t.useRole()', function () { return runTests('./testcafe-fixtures/configuration-test.js', 'Clear configuration', TEST_WITH_IFRAME_FAILED_RUN_OPTIONS) .catch(function (errs) { expect(errs[0]).contains('- Error in Role initializer - A native alert dialog was invoked'); - expect(errs[0]).contains('> 32 | await t.click(showAlertBtn);'); + expect(errs[0]).contains('> 34 | await t.click(showAlertBtn);'); }); });