mediawiki-extensions-Revisi.../tests/selenium/specs/tooltips.js
Svantje Lilienthal 3726c47ad2 ported tooltips.feature from ruby to node.js
Bug: T267204
Change-Id: I76f71532030afc6f12b29f117e5161b40c2f9cd1
2020-11-11 17:45:27 +00:00

56 lines
1 KiB
JavaScript

'use strict';
const assert = require( 'assert' ),
DiffPage = require( '../pageobjects/diff.page' );
describe( 'RevisionSlider revision tooltips', function () {
before( function () {
DiffPage.prepareSimpleTests( 2 );
} );
beforeEach( function () {
DiffPage.ready();
DiffPage.openSlider();
} );
afterEach( function () {
browser.refresh();
} );
it( 'should appear on hover', function () {
DiffPage.dwellRevision( 1 );
DiffPage.dwellRevision( 2 );
assert(
DiffPage.getTooltip( 2 ).isDisplayed(), 'tooltip 2 should appear'
);
assert(
!DiffPage.getTooltip( 1 ).isDisplayed(), 'tooltip 1 should not appear'
);
} );
it( 'appears and remains on hover', function () {
DiffPage.dwellRevision( 1 );
DiffPage.getTooltip( 1 ).moveTo();
DiffPage.dwellRevision( 2 );
DiffPage.getTooltip( 2 ).moveTo();
assert(
DiffPage.getTooltip( 2 ).isDisplayed(), 'tooltip 2 should appear'
);
assert(
!DiffPage.getTooltip( 1 ).isDisplayed(), 'tooltip 1 should not appear'
);
} );
} );