Skip to content

Commit

Permalink
Revert "Hightlight e2e tests (#4456)"
Browse files Browse the repository at this point in the history
This reverts commit 8edb4ce.
  • Loading branch information
petrjasek authored May 22, 2024
1 parent b9fa01e commit a4f179c
Show file tree
Hide file tree
Showing 30 changed files with 34 additions and 228 deletions.
5 changes: 3 additions & 2 deletions e2e/client/playwright/authoring.correct.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ test('correcting with unsaved changes', async ({page}) => {

// publishing the article end

// TODO: should be 'monitoring-group=Sports / output'
await page.locator(
s('monitoring-group=Sports desk output', 'article-item=test sports story'),
s('monitoring-group=Sports', 'article-item=test sports story'),
).dblclick({timeout: 10000}); // need to wait until published item appears in output

await page.locator(s('authoring', 'authoring-topbar')).getByLabel('Correct').click();
Expand All @@ -50,7 +51,7 @@ test('correcting with unsaved changes', async ({page}) => {
await page.locator(s('authoring', 'authoring-topbar')).getByRole('button', {name: 'Send Correction'}).click();

await page.locator(
s('monitoring-group=Sports desk output', 'article-item=test sports story [corrected]'),
s('monitoring-group=Sports', 'article-item=test sports story [corrected]'),
).dblclick({timeout: 10000}); // need to wait until published item appears in output

// initialize correction only to make field editable and accessible using the same selector
Expand Down
5 changes: 1 addition & 4 deletions e2e/client/playwright/desks.spec.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
import {test, expect} from '@playwright/test';
import {restoreDatabaseSnapshot, s} from './utils';
import {Monitoring} from './page-object-models/monitoring';

/**
* when a desk is mentioned in article comments,
* a notification must show up next to an incoming stage of that desk
*/
test('desk notifications', async ({page}) => {
const monitoring = new Monitoring(page);

await restoreDatabaseSnapshot();

await page.goto('/#/workspace/monitoring');

await monitoring.selectDeskOrWorkspace('Sports');
await page.locator(
s('monitoring-group=Sports / Working Stage', 'article-item=test sports story'),
).dblclick();
Expand Down
173 changes: 0 additions & 173 deletions e2e/client/playwright/hightlights.spec.ts

This file was deleted.

2 changes: 0 additions & 2 deletions e2e/client/playwright/monitoring.duplication.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ test('duplicate in place action', async ({page}) => {

await page.goto('/#/workspace/monitoring');

await monitoring.selectDeskOrWorkspace('Sports');
await expect(page.locator(articleSelector)).toHaveCount(1);

const initialItemsCountAcrossAllStages = await page.locator(s('article-item')).count();
Expand Down Expand Up @@ -40,7 +39,6 @@ test('duplicate to personal space action', async ({page}) => {

await page.goto('/#/workspace/monitoring');

await monitoring.selectDeskOrWorkspace('Sports');
await monitoring.executeActionOnMonitoringItem(
page.locator(articleSelector),
'Duplicate',
Expand Down
3 changes: 0 additions & 3 deletions e2e/client/playwright/monitoring.personal-space.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ test('sending an item from personal space', async ({page}) => {
page.locator(s('article-item=personal space article 1')),
'Send to',
);
await page.locator(s('destination-select', 'open-popover')).click();
await page.locator(s('tree-select-popover')).locator(s('option'), {hasText: 'Sports'}).click();
await page.locator(s('interactive-actions-panel')).locator(s('item'), {hasText: 'Working Stage'}).check();
await page.locator(s('interactive-actions-panel', 'send')).click();

Expand All @@ -72,6 +70,5 @@ test('sending an item from personal space', async ({page}) => {

// go to monitoring and check visibility of article
await page.goto('/#/workspace/monitoring');
await monitoring.selectDeskOrWorkspace('Sports');
await expect(page.locator(s('monitoring-view', 'monitoring-group=Sports / Working Stage'))).toBeVisible();
});
11 changes: 2 additions & 9 deletions e2e/client/playwright/page-object-models/monitoring.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {Page, Locator} from '@playwright/test';
import {nameof} from 'core/helpers/typescript-helpers';
import {s} from '../utils';

export class Monitoring {
Expand Down Expand Up @@ -38,7 +37,7 @@ export class Monitoring {
.click();
}

async createArticleFromTemplate(template: string, options?: {slugline?:string, body_html?: string}): Promise<void> {
async createArticleFromTemplate(template: string, options?: {slugline?: string}): Promise<void> {
await this.page.locator(s('content-create')).click();
await this.page.locator(s('content-create-dropdown')).getByRole('button', {name: 'More Templates...'}).click();
await this.page.locator(s('content-create-dropdown')).getByRole('button', {name: template}).click();
Expand All @@ -47,13 +46,7 @@ export class Monitoring {
let keys = Object.keys(options);

for (const key of keys) {
if (key === nameof<typeof options>('slugline')) {
await this.page.locator(s('authoring', `field-${key}`)).fill(options[key]);
} else {
await this.page.locator(
s('authoring', `authoring-field=${key}`),
).getByRole('textbox').fill(options[key]);
}
await this.page.locator(s('authoring', `field-${key}`)).fill(options[key]);
}
}
}
Expand Down
Binary file not shown.
Binary file not shown.
Binary file modified e2e/server/dump/full/main/superdesk_e2e/activity.json.bz2
Binary file not shown.
Binary file modified e2e/server/dump/full/main/superdesk_e2e/archive.json.bz2
Binary file not shown.
Binary file not shown.
Binary file modified e2e/server/dump/full/main/superdesk_e2e/archive_versions.json.bz2
Binary file not shown.
Binary file modified e2e/server/dump/full/main/superdesk_e2e/audit.json.bz2
Binary file not shown.
Binary file modified e2e/server/dump/full/main/superdesk_e2e/auth.json.bz2
Binary file not shown.
Binary file not shown.
Binary file modified e2e/server/dump/full/main/superdesk_e2e/desks.json.bz2
Binary file not shown.
Binary file modified e2e/server/dump/full/main/superdesk_e2e/highlights.json.bz2
Binary file not shown.
Binary file modified e2e/server/dump/full/main/superdesk_e2e/sequences.json.bz2
Binary file not shown.
Binary file modified e2e/server/dump/full/main/superdesk_e2e/stages.json.bz2
Binary file not shown.
Binary file modified e2e/server/dump/full/main/superdesk_e2e/users.json.bz2
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion scripts/apps/highlights/components/HighlightBtn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default class HighlightBtn extends React.Component<any, any> {

return React.createElement(
'button',
{disabled: isMarked, onClick: this.markHighlight, 'aria-label': highlight.label},
{disabled: isMarked, onClick: this.markHighlight},
React.createElement('i', {className: 'icon-star'}),
highlight.label,
);
Expand Down
21 changes: 9 additions & 12 deletions scripts/apps/highlights/controllers/HighlightsSettings.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
import _ from 'lodash';

HighlightsSettings.$inject = ['$scope', 'api', 'desks', '$q'];
export function HighlightsSettings($scope, api, desks, $q) {
$scope.initialized = false;

$q.all([
api.query('content_templates', {where: {template_type: 'highlights'}}),
desks.initialize(),
]).then(([result]) => {
HighlightsSettings.$inject = ['$scope', 'api', 'desks'];
export function HighlightsSettings($scope, api, desks) {
desks.initialize().then(() => {
$scope.desks = desks.deskLookup;
$scope.templates = result._items || [];
$scope.hours = _.range(1, 25);
$scope.auto = {day: 'now/d', week: 'now/w'};
});

$scope.initialized = true;
api.query('content_templates', {where: {template_type: 'highlights'}}).then((result) => {
$scope.templates = result._items || [];
});

$scope.hours = _.range(1, 25);
$scope.auto = {day: 'now/d', week: 'now/w'};
}
8 changes: 4 additions & 4 deletions scripts/apps/highlights/views/highlights_config_modal.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div sd-modal data-model="modalActive" data-close="cancel()" data-test-id="'highlight-configuration-modal'">
<div sd-modal data-model="modalActive" data-close="cancel()">
<div class="modal__header modal__header--flex">
<h3 class="modal__heading" ng-show="!configEdit._id" translate>Create highlight configuration</h3>
<h3 class="modal__heading" ng-show="configEdit._id" translate-params-name="configEdit.name" translate>Edit "{{name}}" highlight</h3>
Expand All @@ -9,7 +9,7 @@ <h3 class="modal__heading" ng-show="configEdit._id" translate-params-name="confi
<fieldset>
<div class="sd-line-input sd-line-input--required sd-line-input--boxed" ng-class="{'sd-line-input--invalid' : _errorUniqueness || _errorLimits}">
<label class="sd-line-input__label">{{'Configuration name' | translate}}</label>
<input class="sd-line-input__input" type="text" ng-model="configEdit.name" ng-keyup="handleEdit($event);" aria-label="{{'Configuration name' | translate}}" required>
<input class="sd-line-input__input" type="text" ng-model="configEdit.name" ng-keyup="handleEdit($event);" required>
<div class="sd-line-input__char-count" sd-character-count data-item="configEdit.name" data-limit="limits.highlight"></div>
<div ng-show="_errorLimits" class="sd-line-input__message sd-line-input__message--with-char-count"><span translate>Character limit exceeded, highlight can not be created/updated.</span></div>
<div ng-show="_errorUniqueness" class="sd-line-input__message"><span translate>Highlight with name</span> "{{ configEdit.name }}" <span translate>already exists</span>.</div>
Expand All @@ -27,8 +27,8 @@ <h3 class="modal__heading" ng-show="configEdit._id" translate-params-name="confi
<label class="form-label form__row-label">{{'Assigned desks' | translate}}</label>
<div class="multi-select">
<ul class="simple-list simple-list--dotted simple-list--no-padding">
<li ng-repeat="desk in assignedDesks" class="simple-list__item" aria-label="{{desk.name}}">
<span sd-check ng-model="desk.included" data-test-id="desk-checkbox" data-test-value="{{desk.name}}"></span>
<li ng-repeat="desk in assignedDesks" class="simple-list__item">
<span sd-check ng-model="desk.included"></span>
<span class="text" ng-click="desk.included = !desk.included">{{desk.name}}</span>
</li>
</ul>
Expand Down
8 changes: 4 additions & 4 deletions scripts/apps/highlights/views/settings.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<sd-settings-view ng-if="initialized">
<sd-settings-view>
<div class="sd-page__main-content" sd-highlights-config>
<div class="sd-page__header sd-page__header--white">
<h2 class="sd-page__page-heading" translate>Highlights configurations</h2>
</div>
<div class="sd-page__header">
<sd-search-handler ng-model="query.name" data-debounce="200"></sd-search-handler>

<span class="sd-page__element-grow"></span>
<button class="btn btn--primary pull-right" ng-click="edit({})">
<i class="icon-plus-sign icon--white"></i>{{ 'Create configuration' | translate }}
</button>
</div>
<div class="sd-page__content">
<ul class="pills-list" data-test-id="highlights-list">
<li ng-repeat="config in configurations._items | filter: query track by config._id" class="clearfix" data-test-id="highlights-item" data-test-value="{{ config.name }}">
<ul class="pills-list">
<li ng-repeat="config in configurations._items | filter: query track by config._id" class="clearfix">
<h6 class="pull-left" title="{{ config.name }}">{{ config.name }}</h6>
<div class="actions">
<button ng-click="edit(config)" title="{{:: 'Edit configuration' | translate }}"><i class="icon-pencil"></i></button>
Expand Down
2 changes: 1 addition & 1 deletion scripts/apps/monitoring/views/monitoring-group.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'sd-kanban-list__board': viewColumn,
}"
data-test-id="monitoring-group"
data-test-value="{{group.type === 'deskOutput' ? group.header + ' desk output' : group.header + (group.subheader ? ' / ' : '') + group.subheader}}"
data-test-value="{{group.header}}{{group.subheader ? ' / ' : ''}}{{group.subheader}}"
>

<div sd-monitoring-group-header
Expand Down
1 change: 0 additions & 1 deletion scripts/apps/packaging/views/sd-package-edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<label translate>Headline</label>
<sd-character-count data-item="item.headline" data-limit="schema.headline.maxlength"></sd-character-count>
<textarea
data-test-id="package-title"
class="title"
id="title"
sd-auto-height
Expand Down
Loading

0 comments on commit a4f179c

Please sign in to comment.