2019-06-27 17:04:10 +02:00
|
|
|
import { Selector } from 'testcafe';
|
|
|
|
import testcafeconfig from './testcafeconfig';
|
|
|
|
import Page from "./page-model";
|
|
|
|
import { RequestLogger } from 'testcafe';
|
|
|
|
|
|
|
|
const logger = RequestLogger({ url: /http:\/\/localhost:2342/, method: 'post'} , {
|
|
|
|
logResponseHeaders: true,
|
|
|
|
logResponseBody: true,
|
|
|
|
stringifyResponseBody: true
|
|
|
|
});
|
|
|
|
|
|
|
|
fixture`Test batch private`
|
|
|
|
.page`${testcafeconfig.url}`
|
|
|
|
.requestHooks(logger);
|
|
|
|
|
|
|
|
const page = new Page();
|
|
|
|
|
|
|
|
test('Make photos private', async t => {
|
2019-07-02 18:17:07 +02:00
|
|
|
await page.selectPhoto(0);
|
|
|
|
await page.selectPhoto(2);
|
2019-06-27 17:04:10 +02:00
|
|
|
await t
|
|
|
|
.click(Selector('div.p-photo-clipboard'))
|
|
|
|
.click(Selector('.p-photo-clipboard-private'), {timeout: 15000});
|
|
|
|
const request = await logger.requests[0].responseBody;
|
|
|
|
await t
|
|
|
|
.expect(logger.requests[0].response.statusCode).eql(200)
|
|
|
|
.expect(logger.requests[0].response.body).contains('photos marked as private');
|
2019-12-10 19:56:32 +01:00
|
|
|
await t.expect(Selector('#t-clipboard').exists).eql(false);
|
|
|
|
});
|