Skip to content

Commit

Permalink
0.18.6-dev2017122 (DevExpress#2001)
Browse files Browse the repository at this point in the history
  • Loading branch information
LavrovArtem authored and kirovboris committed Dec 18, 2019
1 parent 8a94c26 commit bcddc14
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 48 deletions.
14 changes: 4 additions & 10 deletions Gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ var CLIENT_TESTS_DESKTOP_BROWSERS = [
version: '11.0'
},
{
platform: 'OS X 10.11',
platform: 'OS X 10.12',
browserName: 'safari',
version: '9.0'
version: '11.0'
},
{
platform: 'OS X 10.11',
Expand Down Expand Up @@ -119,20 +119,14 @@ var CLIENT_TESTS_MOBILE_BROWSERS = [
version: '5.1',
deviceName: 'Android Emulator'
},
{
platform: 'OS X 10.10',
browserName: 'iphone',
version: '8.1',
deviceName: 'iPad Simulator'
},
{
platform: 'iOS',
browserName: 'Safari',
// NOTE: https://github.com/DevExpress/testcafe/issues/471
// problem with extra scroll reproduced only on saucelabs
// virtual machines with ios device emulators
version: '9.3',
deviceName: 'iPhone 6 Plus'
version: '10.3',
deviceName: 'iPhone 7 Plus Simulator'
}
];

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "testcafe",
"description": "Automated browser testing for the modern web development stack.",
"license": "MIT",
"version": "0.18.6-dev20171211",
"version": "0.18.6-dev20171222",
"author": {
"name": "Developer Express Inc.",
"url": "https://www.devexpress.com/"
Expand Down Expand Up @@ -102,7 +102,7 @@
"stack-chain": "^1.3.6",
"strip-bom": "^2.0.0",
"testcafe-browser-tools": "1.4.6",
"testcafe-hammerhead": "12.1.5",
"testcafe-hammerhead": "12.1.6",
"testcafe-legacy-api": "3.1.2",
"testcafe-reporter-json": "^2.1.0",
"testcafe-reporter-list": "^2.1.0",
Expand Down Expand Up @@ -145,7 +145,7 @@
"gulp-mocha": "^3.0.1",
"gulp-mustache": "^1.1.1",
"gulp-prompt": "^0.2.0",
"gulp-qunit-harness": "^0.1.10",
"gulp-qunit-harness": "^1.0.1",
"gulp-rename": "^1.2.2",
"gulp-uglify": "^1.5.1",
"gulp-util": "^3.0.7",
Expand Down
2 changes: 1 addition & 1 deletion src/client/automation/playback/click/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export default class ClickAutomation extends VisibleElementAutomation {
// NOTE: In WebKit and IE, the mousedown event opens the select element's dropdown;
// therefore, we should prevent mousedown and hide the dropdown (B236416).
var needCloseSelectDropDown = (browserUtils.isWebKit || browserUtils.isIE) &&
domUtils.isSelectElement(this.element);
domUtils.isSelectElement(this.mouseDownElement);

if (needCloseSelectDropDown)
this._bindMousedownHandler();
Expand Down
2 changes: 1 addition & 1 deletion src/client/automation/playback/press/shortcuts.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ function submitFormOnEnterPressInInput (form, inputElement) {
// NOTE: the form is submitted on enter press if there is only one input of the following types on it
// and this input is focused (http://www.w3.org/TR/html5/forms.html#implicit-submission)
if (textInputs.length === 1 && textInputs[0] === inputElement) {
var isInputValid = browserUtils.isSafari || !inputElement.validity || inputElement.validity.valid;
var isInputValid = inputElement.validity.valid;

if (isInputValid && eventSimulator.submit(form))
form.submit();
Expand Down
5 changes: 3 additions & 2 deletions src/client/automation/playback/select/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ function getSelectionRectangle (element, position) {
var range = document.createRange(); //B254723

range.setStart(fakeDiv.firstChild, Math.min(position, element.value.length));
range.setEnd(fakeDiv.firstChild, Math.min(position, element.value.length));
// NOTE: The range.getClientRects function returns wrong result if range length is 0 in Safari 11
range.setEnd(fakeDiv.firstChild, Math.min(position + 1, element.value.length + 1));

if (domUtils.isTextAreaElement(element)) {
rect = range.getBoundingClientRect();
Expand Down Expand Up @@ -137,7 +138,7 @@ function createFakeDiv (element) {
height: element.scrollHeight + 'px'
});

fakeDiv.textContent = !element.value.length ? ' ' : element.value;
fakeDiv.textContent = element.value + ' ';

body.appendChild(fakeDiv);

Expand Down
5 changes: 2 additions & 3 deletions test/client/config-qunit-server-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ module.exports = function (app) {
});
});

app.get('/respond-500', function (req, res) {
res.statusCode = 500;
res.send('Server error');
app.get('/close-request', function (req) {
req.destroy();
});
};
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ var parseKeySequence = testCafeCore.get('./utils/parse-key-sequence');
testCafeCore.preventRealEvents();

$(document).ready(function () {
// NOTE: https://github.com/DevExpress/testcafe/issues/2008
// Remove this condition when the issue will be fixed.
if (browserUtils.isSafari && browserUtils.version === 11)
return;

var $el = null;
var $parent = null;

Expand Down
13 changes: 0 additions & 13 deletions test/client/fixtures/automation/select-element-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1273,20 +1273,7 @@ $(document).ready(function () {
notEqual($(shadowUI.select('.' + OPTION_LIST_CLASS)).is(':visible'), true);
equal(shadowUI.select('.' + OPTION_LIST_CLASS).length, 0);
equal(select.selectedIndex, 0);
startNext();
});
});

asyncTest('B237794 - Select options list doesn\'t close after dblclick in Chrome and Opera (dblclick)', function () {
var select = createSelect();

equal(shadowUI.select('.' + OPTION_LIST_CLASS).length, 0);

runDblClickAutomation(select, {}, function () {
equal(select, document.activeElement);
notEqual($(shadowUI.select('.' + OPTION_LIST_CLASS)).is(':visible'), true);
equal(shadowUI.select('.' + OPTION_LIST_CLASS).length, 0);
equal(select.selectedIndex, 0);
startNext();
});
});
Expand Down
13 changes: 7 additions & 6 deletions test/client/fixtures/automation/submit-on-enter-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ $(document).ready(function () {
function isInputValueValid ($el) {
var el = $el[0];

return browserUtils.isSafari || !el.validity || el.validity.valid;
return el.validity.valid;
}

function runPressAutomation (keys, callback) {
Expand Down Expand Up @@ -302,6 +302,7 @@ $(document).ready(function () {
var inputKeyupHandlerExecuted = false;
var inputKeypressHandlerExecuted = false;
var submitFunctionCalled = false;
var needToPreventEvent = browserUtils.isFirefox || browserUtils.isSafari && browserUtils.version > 9;

$input.bind('keydown', function () {
inputKeydownHandlerExecuted = true;
Expand All @@ -325,13 +326,13 @@ $(document).ready(function () {

$form[0].addEventListener('submit', function (e) {
submitHandlerExecuted = true;
if (browserUtils.isFirefox)
if (needToPreventEvent)
e.preventDefault();
});

//submit event dispatching leads to form submit in FireFox
//in other browsers we call submit function after submit event dispatched (if there are no submit buttons on form)
if (!browserUtils.isFirefox) {
// NOTE: submit event dispatching leads to form submit in FireFox and Safari version 10 or higher
// in other browsers we call submit function after submit event dispatched (if there are no submit buttons on form)
if (!needToPreventEvent) {
$form[0].submit = function () {
submitFunctionCalled = true;
};
Expand All @@ -344,7 +345,7 @@ $(document).ready(function () {
ok(inputKeydownHandlerExecuted, 'input keydown handler executed');
ok(inputKeypressHandlerExecuted, 'input keydown handler executed');
ok(inputKeyupHandlerExecuted, 'input keydown handler executed');
if (!browserUtils.isFirefox)
if (!needToPreventEvent)
ok(submitFunctionCalled, 'submit function called');

start();
Expand Down
11 changes: 10 additions & 1 deletion test/client/fixtures/core/request-barrier-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,19 @@ $(document).ready(function () {

var requestBarrier = new RequestBarrier();

fetch('/respond-500')
fetch('/close-request')
.then(function (response) {
return response.text();
})
.then(function (text) {
// NOTE: On the SauceLab, requests from browser to a destination server is passed via Squid proxy.
// If destination server aborts a request then Squid respond with service error web page.
// In this case we should manually raise an error.
if (text.indexOf('Zero Sized Reply') !== -1)
throw new Error();

ok(false, text);
})
.catch(function () {
requestIsFailed = true;
});
Expand Down
16 changes: 8 additions & 8 deletions test/functional/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ testingEnvironments[testingEnvironmentNames.mobileBrowsers] = {
accessKey: process.env.BROWSER_STACK_ACCESS_KEY
},

// NOTE: Android tests are temporary disabled due to ERR_CONNECTION_REFUSED on Browserstack
browsers: [
{
realMobile: true,
os: 'android',
osVersion: '7.1',
device: 'Google Pixel',
name: 'Android',
alias: 'android'
},
// {
// os: 'android',
// osVersion: '7.1',
// device: 'Google Pixel',
// name: 'Android Browser',
// alias: 'android'
// },
{
os: 'ios',
osVersion: '10.0',
Expand Down

0 comments on commit bcddc14

Please sign in to comment.