Skip to content

Commit

Permalink
restore e2e test: can set embargo and send
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaskikutis committed Sep 20, 2023
1 parent f697188 commit 33ee04b
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions e2e/client/specs/content_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {content} from './helpers/content';
import {authoring} from './helpers/authoring';
import {multiAction} from './helpers/actions';
import {ECE, el} from '@superdesk/end-to-end-testing-helpers';
import {TreeSelectDriver} from './helpers/tree-select-driver';

describe('content', () => {
var body = element(by.tagName('body'));
Expand Down Expand Up @@ -236,4 +237,47 @@ describe('content', () => {

content.closePreview();
});

it('can set embargo and send', () => {
// Initial steps before proceeding, to get initial state of send buttons.
workspace.editItem('item3', 'SPORTS');
authoring.sendTo('Sports Desk', 'Incoming Stage');
authoring.confirmSendTo();

workspace.editItem('item3', 'SPORTS');

el(['open-send-publish-pane']).click();

el(['authoring', 'interactive-actions-panel', 'tabs'], by.buttonText('Send to')).click();

const sendToButton = el(['authoring', 'interactive-actions-panel', 'send']);

browser.wait(ECE.visibilityOf(sendToButton));

new TreeSelectDriver(
el(['interactive-actions-panel', 'destination-select']),
).setValue('Sports Desk');

const stage = 'two';

// State after selecting different Stage in the same desk
el(
['interactive-actions-panel', 'stage-select'],
by.cssContainingText('[data-test-id="item"]', stage),
).click();

expect(sendToButton.isEnabled()).toBe(true);

// State after setting Embargo
setEmbargo();
browser.sleep(100);
expect(sendToButton.isEnabled()).toBe(true);

// State after changing Desk
new TreeSelectDriver(
el(['interactive-actions-panel', 'destination-select']),
).setValue('Politic Desk');

expect(sendToButton.isEnabled()).toBe(true);
});
});

0 comments on commit 33ee04b

Please sign in to comment.