2019-05-21 15:00:46 +00:00
|
|
|
import { Selector } from 'testcafe';
|
|
|
|
import testcafeconfig from './testcafeconfig';
|
|
|
|
import Page from "./page-model";
|
|
|
|
|
2019-06-27 15:02:02 +00:00
|
|
|
fixture`Test clipboard`
|
2019-05-21 15:00:46 +00:00
|
|
|
.page`${testcafeconfig.url}`;
|
|
|
|
|
|
|
|
const page = new Page();
|
|
|
|
|
2019-06-27 15:02:02 +00:00
|
|
|
test('Test selecting photos and clear clipboard', async t => {
|
2019-12-10 18:56:32 +00:00
|
|
|
const clipboardCount = await Selector('span.t-clipboard-count');
|
2019-06-20 14:17:43 +00:00
|
|
|
|
2019-07-02 16:16:55 +00:00
|
|
|
await page.selectPhoto(0);
|
|
|
|
await page.selectPhoto(2);
|
2019-06-20 14:17:43 +00:00
|
|
|
|
|
|
|
await t
|
2019-12-10 18:56:32 +00:00
|
|
|
.expect(clipboardCount.textContent).eql("2");
|
2019-07-02 16:16:55 +00:00
|
|
|
await page.unselectPhoto(0);
|
2019-06-20 14:17:43 +00:00
|
|
|
|
|
|
|
await t
|
2019-12-10 18:56:32 +00:00
|
|
|
.expect(clipboardCount.textContent).eql("1")
|
2019-06-20 14:17:43 +00:00
|
|
|
|
2019-05-21 15:00:46 +00:00
|
|
|
await page.openNav();
|
|
|
|
await t
|
2019-05-28 01:49:44 +00:00
|
|
|
.click('a[href="/labels"]')
|
2019-06-09 02:37:02 +00:00
|
|
|
.expect(Selector('main .p-page-labels').exists, {timeout: 5000}).ok();
|
2019-05-21 15:00:46 +00:00
|
|
|
await page.openNav();
|
|
|
|
await t
|
|
|
|
.click('a[href="/photos"]')
|
2019-12-10 18:56:32 +00:00
|
|
|
.expect(clipboardCount.textContent).eql("1")
|
2019-06-27 15:02:02 +00:00
|
|
|
.click(Selector('div.p-photo-clipboard'))
|
|
|
|
.click(Selector('.p-photo-clipboard-clear'), {timeout: 15000});
|
2019-12-10 18:56:32 +00:00
|
|
|
|
|
|
|
await t.expect(Selector('#t-clipboard').exists).eql(false);
|
2019-05-21 15:59:12 +00:00
|
|
|
});
|