wix-style-processor
Advanced tools
Comparing version 3.1.1 to 3.1.2
@@ -39,4 +39,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function waitForVisibilityOf(element) { | ||
browser.wait(ExpectedConditions.visibilityOf(element)); | ||
return { and: element }; | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, browser.wait(ExpectedConditions.visibilityOf(element))]; | ||
case 1: | ||
_a.sent(); | ||
return [2 /*return*/, { and: element }]; | ||
} | ||
}); | ||
}); | ||
} | ||
@@ -47,8 +55,15 @@ function elementByDataHook(dataHook) { | ||
describe('Style Processor Scenario', function () { | ||
beforeEach(function () { | ||
browser.executeAsyncScript(function (executeDone) { | ||
window.name = 'E2E'; | ||
executeDone(); | ||
beforeEach(function () { return __awaiter(_this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, browser.executeAsyncScript(function (executeDone) { | ||
window.name = 'E2E'; | ||
executeDone(); | ||
})]; | ||
case 1: | ||
_a.sent(); | ||
return [2 /*return*/]; | ||
} | ||
}); | ||
}); | ||
}); }); | ||
it('should not change the number of style tags', function () { return __awaiter(_this, void 0, void 0, function () { | ||
@@ -61,17 +76,21 @@ var styleNum, _a, _b; | ||
_c.sent(); | ||
waitForVisibilityOf(elementByDataHook('text')); | ||
return [4 /*yield*/, waitForVisibilityOf(elementByDataHook('text'))]; | ||
case 2: | ||
_c.sent(); | ||
return [4 /*yield*/, $$('style').count()]; | ||
case 2: | ||
case 3: | ||
styleNum = _c.sent(); | ||
browser.executeAsyncScript(function (executeDone) { | ||
window.styleProcessor.init({}) | ||
.then(executeDone); | ||
}); | ||
return [4 /*yield*/, browser.executeAsyncScript(function (executeDone) { | ||
window.styleProcessor.init({}) | ||
.then(executeDone); | ||
})]; | ||
case 4: | ||
_c.sent(); | ||
_a = expect; | ||
return [4 /*yield*/, (elementByDataHook('text').getCssValue('color'))]; | ||
case 3: | ||
case 5: | ||
_a.apply(void 0, [_c.sent()]).toBe('rgba(255, 255, 255, 1)'); | ||
_b = expect; | ||
return [4 /*yield*/, ($$('style').count())]; | ||
case 4: | ||
case 6: | ||
_b.apply(void 0, [_c.sent()]).toBe(styleNum); | ||
@@ -89,21 +108,27 @@ return [2 /*return*/]; | ||
_c.sent(); | ||
waitForVisibilityOf(elementByDataHook('text')); | ||
return [4 /*yield*/, waitForVisibilityOf(elementByDataHook('text'))]; | ||
case 2: | ||
_c.sent(); | ||
return [4 /*yield*/, $$('style').count()]; | ||
case 2: | ||
case 3: | ||
styleNum = _c.sent(); | ||
browser.executeAsyncScript(function (executeDone) { | ||
window.styleProcessor.init({}) | ||
.then(executeDone); | ||
}); | ||
browser.executeAsyncScript(function (executeDone) { | ||
window.changeStyles(); | ||
executeDone(); | ||
}); | ||
return [4 /*yield*/, browser.executeAsyncScript(function (executeDone) { | ||
window.styleProcessor.init({}) | ||
.then(executeDone); | ||
})]; | ||
case 4: | ||
_c.sent(); | ||
return [4 /*yield*/, browser.executeAsyncScript(function (executeDone) { | ||
window.changeStyles(); | ||
executeDone(); | ||
})]; | ||
case 5: | ||
_c.sent(); | ||
_a = expect; | ||
return [4 /*yield*/, (elementByDataHook('text').getCssValue('color'))]; | ||
case 3: | ||
case 6: | ||
_a.apply(void 0, [_c.sent()]).toBe('rgba(0, 0, 0, 1)'); | ||
_b = expect; | ||
return [4 /*yield*/, $$('style').count()]; | ||
case 4: | ||
case 7: | ||
_b.apply(void 0, [_c.sent()]).toBe(styleNum); | ||
@@ -110,0 +135,0 @@ return [2 /*return*/]; |
@@ -5,3 +5,3 @@ { | ||
"description": "An alternative Wix Styles TPA processor", | ||
"version": "3.1.1", | ||
"version": "3.1.2", | ||
"author": { | ||
@@ -8,0 +8,0 @@ "name": "Eran Shabi", |
Sorry, the diff of this file is not supported yet
417934
6558