Skip to content

Commit

Permalink
Migrate for playwright
Browse files Browse the repository at this point in the history
  • Loading branch information
rosano committed Dec 2, 2023
1 parent 5d76f77 commit 848c08d
Show file tree
Hide file tree
Showing 14 changed files with 186 additions and 197 deletions.
18 changes: 9 additions & 9 deletions os-app/open-glance/ui-test-_access.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,39 +43,39 @@ describe('ZDAGlance_Access', function () {
});

it('shows ZDAGlance', function() {
browser.assert.elements(ZDAGlance, 1);
return browser.assert.elements(ZDAGlance, 1);
});

it('shows ZDAGlanceHeader', function () {
browser.assert.elements(ZDAGlanceHeader, 1);
return browser.assert.elements(ZDAGlanceHeader, 1);
});

it('shows ZDAGlanceHeaderOne', function () {
browser.assert.elements(ZDAGlanceHeaderOne, 1);
return browser.assert.elements(ZDAGlanceHeaderOne, 1);
});

it('shows ZDAGlanceHeaderTwo', function () {
browser.assert.elements(ZDAGlanceHeaderTwo, 1);
return browser.assert.elements(ZDAGlanceHeaderTwo, 1);
});

it('shows ZDAGlanceRootLink', function () {
browser.assert.elements(ZDAGlanceRootLink, 1);
return browser.assert.elements(ZDAGlanceRootLink, 1);
});

it('shows ZDAGlanceRootLinkImage', function () {
browser.assert.elements(ZDAGlanceRootLinkImage, 1);
return browser.assert.elements(ZDAGlanceRootLinkImage, 1);
});

it('shows ZDAGlanceFilterInput', function () {
browser.assert.elements(ZDAGlanceFilterInput, 1);
return browser.assert.elements(ZDAGlanceFilterInput, 1);
});

it('shows ZDAGlanceProjectsCompilationLink', function () {
browser.assert.elements(ZDAGlanceProjectsCompilationLink, 1);
return browser.assert.elements(ZDAGlanceProjectsCompilationLink, 1);
});

it('shows ZDAGlanceProtocolButton', function () {
browser.assert.elements(ZDAGlanceProtocolButton, count);
return browser.assert.elements(ZDAGlanceProtocolButton, count);
});

});
8 changes: 4 additions & 4 deletions os-app/open-glance/ui-test-_localize.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ kDefaultRoute.OLSKRouteLanguageCodes.forEach(function (OLSKRoutingLanguage) {
});

it('localizes title', function() {
browser.assert.text('title', uLocalized('ZDAVitrineTitle'));
return browser.assert.text('title', uLocalized('ZDAVitrineTitle'));
});

it('localizes meta[description]', function() {
browser.assert.attribute('meta[name=description]', 'content', uLocalized('ZDAVitrineDescription'));
return browser.assert.attribute('meta[name=description]', 'content', uLocalized('ZDAVitrineDescription'));
});

it('localizes ZDAGlanceRootLink', function () {
browser.assert.attribute(ZDAGlanceRootLink, 'title', uLocalized('OLSKRootLinkTextHome'));
return browser.assert.attribute(ZDAGlanceRootLink, 'title', uLocalized('OLSKRootLinkTextHome'));
});

it('localizes ZDAGlanceFilterInput', function () {
browser.assert.attribute(ZDAGlanceFilterInput, 'placeholder', uLocalized('ZDAGlanceFilterInputText'));
return browser.assert.attribute(ZDAGlanceFilterInput, 'placeholder', uLocalized('ZDAGlanceFilterInputText'));
});

});
Expand Down
42 changes: 21 additions & 21 deletions os-app/open-glance/ui-test-_misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,87 +31,87 @@ describe('ZDAGlance_Misc', function () {
});

it('sets meta:viewport', function () {
browser.assert.attribute('meta[name=viewport]', 'content', 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0');
return browser.assert.attribute('meta[name=viewport]', 'content', 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0');
});

describe('ZDAGlance', function () {

it('classes OLSKDecor', function () {
browser.assert.hasClass(ZDAGlance, 'OLSKDecor');
return browser.assert.hasClass(ZDAGlance, 'OLSKDecor');
});

});

describe('ZDAGlanceHeader', function test_ZDAGlanceHeader () {

it('classes OLSKDecorFixedHeader', function () {
browser.assert.hasClass(ZDAGlanceHeader, 'OLSKDecorFixedHeader');
return browser.assert.hasClass(ZDAGlanceHeader, 'OLSKDecorFixedHeader');
});

});

describe('ZDAGlanceHeaderOne', function test_ZDAGlanceHeaderOne () {

it('classes OLSKCommonEdgeBottom', function () {
browser.assert.hasClass(ZDAGlanceHeaderOne, 'OLSKCommonEdgeBottom');
return browser.assert.hasClass(ZDAGlanceHeaderOne, 'OLSKCommonEdgeBottom');
});

});

describe('ZDAGlanceHeaderTwo', function test_ZDAGlanceHeaderTwo () {

it('classes OLSKCommonEdgeBottom', function () {
browser.assert.hasClass(ZDAGlanceHeaderTwo, 'OLSKCommonEdgeBottom');
return browser.assert.hasClass(ZDAGlanceHeaderTwo, 'OLSKCommonEdgeBottom');
});

it('classes OLSKDecorFormBlend', function () {
browser.assert.hasClass(ZDAGlanceHeaderTwo, 'OLSKDecorFormBlend');
return browser.assert.hasClass(ZDAGlanceHeaderTwo, 'OLSKDecorFormBlend');
});

});

describe('ZDAGlanceRootLink', function test_ZDAGlanceRootLink () {

it('sets href', function () {
browser.assert.attribute(ZDAGlanceRootLink, 'href', require('../open-vitrine/controller.js').OLSKControllerRoutes().shift().OLSKRoutePath);
return browser.assert.attribute(ZDAGlanceRootLink, 'href', require('../open-vitrine/controller.js').OLSKControllerRoutes().shift().OLSKRoutePath);
});

});

describe('ZDAGlanceRootLinkImage', function test_ZDAGlanceRootLinkImage () {

it('sets src', function () {
browser.assert.attribute(ZDAGlanceRootLinkImage, 'src', process.env.ZDA_VITRINE_IDENTITY_URL);
return browser.assert.attribute(ZDAGlanceRootLinkImage, 'src', process.env.ZDA_VITRINE_IDENTITY_URL);
});

});

describe('ZDAGlanceFilterInput', function test_ZDAGlanceFilterInput () {

it('sets type', function () {
browser.assert.attribute(ZDAGlanceFilterInput, 'type', 'search');
return browser.assert.attribute(ZDAGlanceFilterInput, 'type', 'search');
});

it('sets accesskey', function () {
browser.assert.attribute(ZDAGlanceFilterInput, 'accesskey', 'f');
return browser.assert.attribute(ZDAGlanceFilterInput, 'accesskey', 'f');
});

it('classes OLSKDecorInput', function () {
browser.assert.hasClass(ZDAGlanceFilterInput, 'OLSKDecorInput');
return browser.assert.hasClass(ZDAGlanceFilterInput, 'OLSKDecorInput');
});

context('input', function () {

before(function () {
browser.assert.elements('.ZDAGlanceListItem', count);
return browser.assert.elements('.ZDAGlanceListItem', count);
});

before(function () {
browser.fill(ZDAGlanceFilterInput, item.ZDAProjectName);
});

it.skip('filters list', function () {
browser.assert.elements('.ZDAGlanceListItem', 1);
return browser.assert.elements('.ZDAGlanceListItem', 1);
});

});
Expand All @@ -123,11 +123,11 @@ describe('ZDAGlance_Misc', function () {
});

it('filters list', function () {
browser.assert.elements('.ZDAGlanceListItem', count);
return browser.assert.elements('.ZDAGlanceListItem', count);
});

it('sets filter text', function () {
browser.assert.text(ZDAGlanceFilterInput, '');
return browser.assert.text(ZDAGlanceFilterInput, '');
});

});
Expand All @@ -137,11 +137,11 @@ describe('ZDAGlance_Misc', function () {
describe('ZDAGlanceProjectsCompilationLink', function test_ZDAGlanceProjectsCompilationLink () {

it('sets href', function () {
browser.assert.attribute(ZDAGlanceProjectsCompilationLink, 'href', require('../api-projects/controller.js').OLSKControllerRoutes().shift().OLSKRoutePath);
return browser.assert.attribute(ZDAGlanceProjectsCompilationLink, 'href', require('../api-projects/controller.js').OLSKControllerRoutes().shift().OLSKRoutePath);
});

it('sets text', function () {
browser.assert.text(ZDAGlanceProjectsCompilationLink, 'JSON');
return browser.assert.text(ZDAGlanceProjectsCompilationLink, 'JSON');
});

});
Expand All @@ -152,24 +152,24 @@ describe('ZDAGlance_Misc', function () {

describe('ZDAGlanceProtocolButton', function test_ZDAGlanceProtocolButton () {

const selector = `${ ZDAGlanceProtocolButton }:nth-child(${ i + 1 })`;
const selector = `.ZDAGlanceProtocolButton:nth-child(${ i + 1 })`;

it('binds ZDAProtocolName', function () {
browser.assert.text(selector, e[1].ZDABankProtocol.ZDAProtocolName);
return browser.assert.text(selector, e[1].ZDABankProtocol.ZDAProtocolName);
});

context.skip('click', function () {

before(function () {
browser.assert.input(ZDAGlanceFilterInput, text);
return browser.assert.input(ZDAGlanceFilterInput, text);
});

before(function () {
browser.pressButton(selector, item.ZDAProjectName);
});

it('sets ZDAGlanceFilterInput text', function () {
browser.assert.input(ZDAGlanceFilterInput, e[1].ZDABankProtocol.ZDAProtocolName);
return browser.assert.input(ZDAGlanceFilterInput, e[1].ZDABankProtocol.ZDAProtocolName);
});

});
Expand Down
Loading

0 comments on commit 848c08d

Please sign in to comment.