@atlaskit/editor-common 69.2.1 → 69.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/cjs/__tests_external__/cases/fundamentals/collection.js +21 -0
- package/dist/cjs/__tests_external__/cases/fundamentals/test-cases/editor-is-present.js +25 -0
- package/dist/cjs/__tests_external__/cases/fundamentals/test-cases/editor-typing.js +37 -0
- package/dist/cjs/__tests_external__/cases/media/test-cases/alt-text.js +45 -0
- package/dist/cjs/__tests_external__/cases/media/test-cases/caption.js +44 -0
- package/dist/cjs/__tests_external__/cases/media/test-cases/index.js +23 -0
- package/dist/cjs/__tests_external__/cases/media/test-cases/types.js +5 -0
- package/dist/cjs/__tests_external__/cases/media/test-cases/upload.js +38 -0
- package/dist/cjs/__tests_external__/cases/smart-links/index.js +37 -0
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/block/delete.js +43 -0
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/block/edit.js +77 -0
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/block/index.js +23 -0
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/block/insert.js +42 -0
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/embed/delete.js +43 -0
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/embed/edit.js +77 -0
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/embed/index.js +23 -0
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/embed/insert.js +42 -0
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/inline/delete.js +42 -0
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/inline/edit.js +75 -0
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/inline/index.js +25 -0
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/inline/insert.js +41 -0
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/inline/unlink.js +44 -0
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/types.js +5 -0
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/url/index.js +19 -0
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/url/insert.js +39 -0
- package/dist/cjs/__tests_external__/cases/types.js +5 -0
- package/dist/cjs/__tests_external__/index.js +55 -0
- package/dist/cjs/__tests_external__/page-objects/Editor.js +71 -0
- package/dist/cjs/__tests_external__/page-objects/EditorMedia.js +98 -0
- package/dist/cjs/__tests_external__/page-objects/EditorSmartLink.js +232 -0
- package/dist/cjs/__tests_external__/page-objects/Renderer.js +59 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/__tests_external__/cases/fundamentals/collection.js +7 -0
- package/dist/es2019/__tests_external__/cases/fundamentals/test-cases/editor-is-present.js +12 -0
- package/dist/es2019/__tests_external__/cases/fundamentals/test-cases/editor-typing.js +25 -0
- package/dist/es2019/__tests_external__/cases/media/test-cases/alt-text.js +29 -0
- package/dist/es2019/__tests_external__/cases/media/test-cases/caption.js +28 -0
- package/dist/es2019/__tests_external__/cases/media/test-cases/index.js +8 -0
- package/dist/es2019/__tests_external__/cases/media/test-cases/types.js +1 -0
- package/dist/es2019/__tests_external__/cases/media/test-cases/upload.js +23 -0
- package/dist/es2019/__tests_external__/cases/smart-links/index.js +4 -0
- package/dist/es2019/__tests_external__/cases/smart-links/test-cases/block/delete.js +29 -0
- package/dist/es2019/__tests_external__/cases/smart-links/test-cases/block/edit.js +59 -0
- package/dist/es2019/__tests_external__/cases/smart-links/test-cases/block/index.js +8 -0
- package/dist/es2019/__tests_external__/cases/smart-links/test-cases/block/insert.js +28 -0
- package/dist/es2019/__tests_external__/cases/smart-links/test-cases/embed/delete.js +29 -0
- package/dist/es2019/__tests_external__/cases/smart-links/test-cases/embed/edit.js +59 -0
- package/dist/es2019/__tests_external__/cases/smart-links/test-cases/embed/index.js +8 -0
- package/dist/es2019/__tests_external__/cases/smart-links/test-cases/embed/insert.js +28 -0
- package/dist/es2019/__tests_external__/cases/smart-links/test-cases/inline/delete.js +28 -0
- package/dist/es2019/__tests_external__/cases/smart-links/test-cases/inline/edit.js +57 -0
- package/dist/es2019/__tests_external__/cases/smart-links/test-cases/inline/index.js +9 -0
- package/dist/es2019/__tests_external__/cases/smart-links/test-cases/inline/insert.js +27 -0
- package/dist/es2019/__tests_external__/cases/smart-links/test-cases/inline/unlink.js +30 -0
- package/dist/es2019/__tests_external__/cases/smart-links/test-cases/types.js +1 -0
- package/dist/es2019/__tests_external__/cases/smart-links/test-cases/url/index.js +6 -0
- package/dist/es2019/__tests_external__/cases/smart-links/test-cases/url/insert.js +25 -0
- package/dist/es2019/__tests_external__/cases/types.js +1 -0
- package/dist/es2019/__tests_external__/index.js +4 -0
- package/dist/es2019/__tests_external__/page-objects/Editor.js +29 -0
- package/dist/es2019/__tests_external__/page-objects/EditorMedia.js +51 -0
- package/dist/es2019/__tests_external__/page-objects/EditorSmartLink.js +168 -0
- package/dist/es2019/__tests_external__/page-objects/Renderer.js +17 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/__tests_external__/cases/fundamentals/collection.js +9 -0
- package/dist/esm/__tests_external__/cases/fundamentals/test-cases/editor-is-present.js +14 -0
- package/dist/esm/__tests_external__/cases/fundamentals/test-cases/editor-typing.js +25 -0
- package/dist/esm/__tests_external__/cases/media/test-cases/alt-text.js +32 -0
- package/dist/esm/__tests_external__/cases/media/test-cases/caption.js +31 -0
- package/dist/esm/__tests_external__/cases/media/test-cases/index.js +10 -0
- package/dist/esm/__tests_external__/cases/media/test-cases/types.js +1 -0
- package/dist/esm/__tests_external__/cases/media/test-cases/upload.js +26 -0
- package/dist/esm/__tests_external__/cases/smart-links/index.js +4 -0
- package/dist/esm/__tests_external__/cases/smart-links/test-cases/block/delete.js +30 -0
- package/dist/esm/__tests_external__/cases/smart-links/test-cases/block/edit.js +61 -0
- package/dist/esm/__tests_external__/cases/smart-links/test-cases/block/index.js +10 -0
- package/dist/esm/__tests_external__/cases/smart-links/test-cases/block/insert.js +29 -0
- package/dist/esm/__tests_external__/cases/smart-links/test-cases/embed/delete.js +30 -0
- package/dist/esm/__tests_external__/cases/smart-links/test-cases/embed/edit.js +61 -0
- package/dist/esm/__tests_external__/cases/smart-links/test-cases/embed/index.js +10 -0
- package/dist/esm/__tests_external__/cases/smart-links/test-cases/embed/insert.js +29 -0
- package/dist/esm/__tests_external__/cases/smart-links/test-cases/inline/delete.js +29 -0
- package/dist/esm/__tests_external__/cases/smart-links/test-cases/inline/edit.js +59 -0
- package/dist/esm/__tests_external__/cases/smart-links/test-cases/inline/index.js +11 -0
- package/dist/esm/__tests_external__/cases/smart-links/test-cases/inline/insert.js +28 -0
- package/dist/esm/__tests_external__/cases/smart-links/test-cases/inline/unlink.js +31 -0
- package/dist/esm/__tests_external__/cases/smart-links/test-cases/types.js +1 -0
- package/dist/esm/__tests_external__/cases/smart-links/test-cases/url/index.js +8 -0
- package/dist/esm/__tests_external__/cases/smart-links/test-cases/url/insert.js +26 -0
- package/dist/esm/__tests_external__/cases/types.js +1 -0
- package/dist/esm/__tests_external__/index.js +4 -0
- package/dist/esm/__tests_external__/page-objects/Editor.js +56 -0
- package/dist/esm/__tests_external__/page-objects/EditorMedia.js +83 -0
- package/dist/esm/__tests_external__/page-objects/EditorSmartLink.js +218 -0
- package/dist/esm/__tests_external__/page-objects/Renderer.js +45 -0
- package/dist/esm/version.json +1 -1
- package/package.json +2 -3
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { InProductTestCase } from '@atlaskit/in-product-testing';
|
|
2
|
+
import { MediaCardPageObject } from '@atlaskit/media-card/in-product';
|
|
3
|
+
import { EditorPageObject } from '../../../page-objects/Editor';
|
|
4
|
+
export var uploadMediaTestCase = function uploadMediaTestCase(_ref) {
|
|
5
|
+
var ui = _ref.ui,
|
|
6
|
+
fixtures = _ref.fixtures;
|
|
7
|
+
return new InProductTestCase({
|
|
8
|
+
title: 'media upload and publish works',
|
|
9
|
+
id: 'media-file-upload',
|
|
10
|
+
precondition: function precondition() {
|
|
11
|
+
return fixtures.length > 0;
|
|
12
|
+
},
|
|
13
|
+
assertions: function assertions(cy) {
|
|
14
|
+
var editor = new EditorPageObject(cy);
|
|
15
|
+
var mediaCard = new MediaCardPageObject(cy);
|
|
16
|
+
editor.upload(fixtures);
|
|
17
|
+
mediaCard.expectCardReady(fixtures.length);
|
|
18
|
+
|
|
19
|
+
if (ui !== null && ui !== void 0 && ui.publishButton) {
|
|
20
|
+
var renderer = editor.publish(ui);
|
|
21
|
+
renderer.expectContentReady();
|
|
22
|
+
renderer.expectMediaSingleRenders(fixtures.length);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { InProductTestCase } from '@atlaskit/in-product-testing';
|
|
2
|
+
import { BlockCardPageObject, blockSmartLinkRendersTestCase } from '@atlaskit/smart-card/in-product';
|
|
3
|
+
import { EditorPageObject } from '../../../../page-objects/Editor';
|
|
4
|
+
import { EditorSmartLinkPageObject } from '../../../../page-objects/EditorSmartLink';
|
|
5
|
+
export var deleteBlockSmartLinkTestCase = function deleteBlockSmartLinkTestCase(_ref) {
|
|
6
|
+
var ui = _ref.ui,
|
|
7
|
+
url = _ref.url;
|
|
8
|
+
return new InProductTestCase({
|
|
9
|
+
title: 'able to delete a Block Smart Link using floating toolbar',
|
|
10
|
+
id: 'delete-block-smart-link',
|
|
11
|
+
assertions: function assertions(cy) {
|
|
12
|
+
var editor = new EditorPageObject(cy);
|
|
13
|
+
var editorWithSmartLinks = new EditorSmartLinkPageObject(cy, editor);
|
|
14
|
+
var blockCard = new BlockCardPageObject(cy);
|
|
15
|
+
editorWithSmartLinks.insertSmartLinkByTyping(url);
|
|
16
|
+
editorWithSmartLinks.switchAfterInsert('block');
|
|
17
|
+
blockSmartLinkRendersTestCase({
|
|
18
|
+
url: url
|
|
19
|
+
}).assertions(cy);
|
|
20
|
+
editorWithSmartLinks.deleteSmartLink('block');
|
|
21
|
+
blockCard.expectCardNotExists();
|
|
22
|
+
|
|
23
|
+
if (ui !== null && ui !== void 0 && ui.publishButton) {
|
|
24
|
+
var renderer = editor.publish(ui);
|
|
25
|
+
renderer.expectContentReady();
|
|
26
|
+
blockCard.expectCardNotExists();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { InProductTestCase } from '@atlaskit/in-product-testing';
|
|
2
|
+
import { BlockCardPageObject, blockSmartLinkRendersTestCase } from '@atlaskit/smart-card/in-product';
|
|
3
|
+
import { EditorPageObject } from '../../../../page-objects/Editor';
|
|
4
|
+
import { EditorSmartLinkPageObject } from '../../../../page-objects/EditorSmartLink';
|
|
5
|
+
export var editBlockSmartLinkTitleTestCase = function editBlockSmartLinkTitleTestCase(_ref) {
|
|
6
|
+
var ui = _ref.ui,
|
|
7
|
+
url = _ref.url;
|
|
8
|
+
return new InProductTestCase({
|
|
9
|
+
title: 'editing a Block Smart Link renders as Blue Link (title)',
|
|
10
|
+
id: 'block-smart-link-edit-title',
|
|
11
|
+
assertions: function assertions(cy) {
|
|
12
|
+
var editor = new EditorPageObject(cy);
|
|
13
|
+
var editorWithSmartLinks = new EditorSmartLinkPageObject(cy, editor);
|
|
14
|
+
var blockCard = new BlockCardPageObject(cy);
|
|
15
|
+
editorWithSmartLinks.insertSmartLinkByTyping(url);
|
|
16
|
+
editorWithSmartLinks.switchAfterInsert('block');
|
|
17
|
+
blockSmartLinkRendersTestCase({
|
|
18
|
+
url: url
|
|
19
|
+
}).assertions(cy);
|
|
20
|
+
editorWithSmartLinks.changeLinkLabel('Avocorne is watching you 🥑', 'block');
|
|
21
|
+
blockCard.assertHrefRendered(url);
|
|
22
|
+
blockCard.expectCardNotExists();
|
|
23
|
+
|
|
24
|
+
if (ui !== null && ui !== void 0 && ui.publishButton) {
|
|
25
|
+
var renderer = editor.publish(ui);
|
|
26
|
+
renderer.expectContentReady();
|
|
27
|
+
blockCard.assertHrefRendered(url);
|
|
28
|
+
blockCard.expectCardNotExists();
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
export var editBlockSmartLinkUrlTestCase = function editBlockSmartLinkUrlTestCase(_ref2) {
|
|
34
|
+
var ui = _ref2.ui,
|
|
35
|
+
url = _ref2.url;
|
|
36
|
+
return new InProductTestCase({
|
|
37
|
+
title: 'editing a Block Smart Link renders as Blue Link (URL)',
|
|
38
|
+
id: 'block-smart-link-edit',
|
|
39
|
+
assertions: function assertions(cy) {
|
|
40
|
+
var editor = new EditorPageObject(cy);
|
|
41
|
+
var editorWithSmartLinks = new EditorSmartLinkPageObject(cy, editor);
|
|
42
|
+
var blockCard = new BlockCardPageObject(cy);
|
|
43
|
+
editorWithSmartLinks.insertSmartLinkByTyping(url);
|
|
44
|
+
editorWithSmartLinks.switchAfterInsert('block');
|
|
45
|
+
blockSmartLinkRendersTestCase({
|
|
46
|
+
url: url
|
|
47
|
+
}).assertions(cy);
|
|
48
|
+
var newUrl = 'https://avo.corne.com';
|
|
49
|
+
editorWithSmartLinks.changeLinkUrl(newUrl, 'block');
|
|
50
|
+
blockCard.expectCardNotExists();
|
|
51
|
+
blockCard.assertHrefRendered(newUrl);
|
|
52
|
+
|
|
53
|
+
if (ui !== null && ui !== void 0 && ui.publishButton) {
|
|
54
|
+
var renderer = editor.publish(ui);
|
|
55
|
+
renderer.expectContentReady();
|
|
56
|
+
blockCard.assertHrefRendered(newUrl);
|
|
57
|
+
blockCard.expectCardNotExists();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { InProductTestCollection } from '@atlaskit/in-product-testing';
|
|
2
|
+
import { deleteBlockSmartLinkTestCase } from './delete';
|
|
3
|
+
import { editBlockSmartLinkTitleTestCase, editBlockSmartLinkUrlTestCase } from './edit';
|
|
4
|
+
import { switchToBlockSmartLinkTestCase } from './insert';
|
|
5
|
+
export var blockSmartLinksTestCollection = function blockSmartLinksTestCollection(opts) {
|
|
6
|
+
return new InProductTestCollection({
|
|
7
|
+
title: '@atlaskit/editor-core -> Block Smart Links, happy paths',
|
|
8
|
+
testCases: [switchToBlockSmartLinkTestCase(opts), editBlockSmartLinkTitleTestCase(opts), editBlockSmartLinkUrlTestCase(opts), deleteBlockSmartLinkTestCase(opts)]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { InProductTestCase } from '@atlaskit/in-product-testing';
|
|
2
|
+
import { blockSmartLinkRendersTestCase } from '@atlaskit/smart-card/in-product';
|
|
3
|
+
import { EditorPageObject } from '../../../../page-objects/Editor';
|
|
4
|
+
import { EditorSmartLinkPageObject } from '../../../../page-objects/EditorSmartLink';
|
|
5
|
+
export var switchToBlockSmartLinkTestCase = function switchToBlockSmartLinkTestCase(_ref) {
|
|
6
|
+
var ui = _ref.ui,
|
|
7
|
+
url = _ref.url;
|
|
8
|
+
return new InProductTestCase({
|
|
9
|
+
title: 'switching to a Block Smart Link works',
|
|
10
|
+
id: 'switch-to-block',
|
|
11
|
+
assertions: function assertions(cy) {
|
|
12
|
+
var editor = new EditorPageObject(cy);
|
|
13
|
+
var editorWithSmartLinks = new EditorSmartLinkPageObject(cy, editor);
|
|
14
|
+
editorWithSmartLinks.insertSmartLinkByTyping(url);
|
|
15
|
+
editorWithSmartLinks.switchAfterInsert('block');
|
|
16
|
+
blockSmartLinkRendersTestCase({
|
|
17
|
+
url: url
|
|
18
|
+
}).assertions(cy);
|
|
19
|
+
|
|
20
|
+
if (ui !== null && ui !== void 0 && ui.publishButton) {
|
|
21
|
+
var renderer = editor.publish(ui);
|
|
22
|
+
renderer.expectContentReady();
|
|
23
|
+
blockSmartLinkRendersTestCase({
|
|
24
|
+
url: url
|
|
25
|
+
}).assertions(cy);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { InProductTestCase } from '@atlaskit/in-product-testing';
|
|
2
|
+
import { EmbedCardPageObject, embedSmartLinkRendersTestCase } from '@atlaskit/smart-card/in-product';
|
|
3
|
+
import { EditorPageObject } from '../../../../page-objects/Editor';
|
|
4
|
+
import { EditorSmartLinkPageObject } from '../../../../page-objects/EditorSmartLink';
|
|
5
|
+
export var deleteEmbedSmartLinkTestCase = function deleteEmbedSmartLinkTestCase(_ref) {
|
|
6
|
+
var ui = _ref.ui,
|
|
7
|
+
url = _ref.url;
|
|
8
|
+
return new InProductTestCase({
|
|
9
|
+
title: 'able to delete an Embed Smart Link using floating toolbar',
|
|
10
|
+
id: 'delete-embed-smart-link',
|
|
11
|
+
assertions: function assertions(cy) {
|
|
12
|
+
var editor = new EditorPageObject(cy);
|
|
13
|
+
var editorWithSmartLinks = new EditorSmartLinkPageObject(cy, editor);
|
|
14
|
+
var embedCard = new EmbedCardPageObject(cy);
|
|
15
|
+
editorWithSmartLinks.insertSmartLinkByTyping(url);
|
|
16
|
+
editorWithSmartLinks.switchAfterInsert('embed');
|
|
17
|
+
embedSmartLinkRendersTestCase({
|
|
18
|
+
url: url
|
|
19
|
+
}).assertions(cy);
|
|
20
|
+
editorWithSmartLinks.deleteSmartLink('embed');
|
|
21
|
+
embedCard.expectCardNotExists();
|
|
22
|
+
|
|
23
|
+
if (ui !== null && ui !== void 0 && ui.publishButton) {
|
|
24
|
+
var renderer = editor.publish(ui);
|
|
25
|
+
renderer.expectContentReady();
|
|
26
|
+
embedCard.expectCardNotExists();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { InProductTestCase } from '@atlaskit/in-product-testing';
|
|
2
|
+
import { EmbedCardPageObject, embedSmartLinkRendersTestCase } from '@atlaskit/smart-card/in-product';
|
|
3
|
+
import { EditorPageObject } from '../../../../page-objects/Editor';
|
|
4
|
+
import { EditorSmartLinkPageObject } from '../../../../page-objects/EditorSmartLink';
|
|
5
|
+
export var editEmbedSmartLinkTitleTestCase = function editEmbedSmartLinkTitleTestCase(_ref) {
|
|
6
|
+
var ui = _ref.ui,
|
|
7
|
+
url = _ref.url;
|
|
8
|
+
return new InProductTestCase({
|
|
9
|
+
title: 'editing an Embed Smart Link renders as Blue Link (title)',
|
|
10
|
+
id: 'embed-smart-link-edit-title',
|
|
11
|
+
assertions: function assertions(cy) {
|
|
12
|
+
var editor = new EditorPageObject(cy);
|
|
13
|
+
var editorWithSmartLinks = new EditorSmartLinkPageObject(cy, editor);
|
|
14
|
+
var embedCard = new EmbedCardPageObject(cy);
|
|
15
|
+
editorWithSmartLinks.insertSmartLinkByTyping(url);
|
|
16
|
+
editorWithSmartLinks.switchAfterInsert('embed');
|
|
17
|
+
embedSmartLinkRendersTestCase({
|
|
18
|
+
url: url
|
|
19
|
+
}).assertions(cy);
|
|
20
|
+
editorWithSmartLinks.changeLinkLabel('Avocorne is watching you 🥑', 'embed');
|
|
21
|
+
embedCard.assertHrefRendered(url);
|
|
22
|
+
embedCard.expectCardNotExists();
|
|
23
|
+
|
|
24
|
+
if (ui !== null && ui !== void 0 && ui.publishButton) {
|
|
25
|
+
var renderer = editor.publish(ui);
|
|
26
|
+
renderer.expectContentReady();
|
|
27
|
+
embedCard.assertHrefRendered(url);
|
|
28
|
+
embedCard.expectCardNotExists();
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
export var editEmbedSmartLinkUrlTestCase = function editEmbedSmartLinkUrlTestCase(_ref2) {
|
|
34
|
+
var ui = _ref2.ui,
|
|
35
|
+
url = _ref2.url;
|
|
36
|
+
return new InProductTestCase({
|
|
37
|
+
title: 'editing an Embed Smart Link renders as Blue Link (URL)',
|
|
38
|
+
id: 'embed-smart-link-edit',
|
|
39
|
+
assertions: function assertions(cy) {
|
|
40
|
+
var editor = new EditorPageObject(cy);
|
|
41
|
+
var editorWithSmartLinks = new EditorSmartLinkPageObject(cy, editor);
|
|
42
|
+
var embedCard = new EmbedCardPageObject(cy);
|
|
43
|
+
editorWithSmartLinks.insertSmartLinkByTyping(url);
|
|
44
|
+
editorWithSmartLinks.switchAfterInsert('embed');
|
|
45
|
+
embedSmartLinkRendersTestCase({
|
|
46
|
+
url: url
|
|
47
|
+
}).assertions(cy);
|
|
48
|
+
var newUrl = 'https://avo.corne.com';
|
|
49
|
+
editorWithSmartLinks.changeLinkUrl(newUrl, 'embed');
|
|
50
|
+
embedCard.expectCardNotExists();
|
|
51
|
+
embedCard.assertHrefRendered(newUrl);
|
|
52
|
+
|
|
53
|
+
if (ui !== null && ui !== void 0 && ui.publishButton) {
|
|
54
|
+
var renderer = editor.publish(ui);
|
|
55
|
+
renderer.expectContentReady();
|
|
56
|
+
embedCard.assertHrefRendered(newUrl);
|
|
57
|
+
embedCard.expectCardNotExists();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { InProductTestCollection } from '@atlaskit/in-product-testing';
|
|
2
|
+
import { deleteEmbedSmartLinkTestCase } from './delete';
|
|
3
|
+
import { editEmbedSmartLinkTitleTestCase, editEmbedSmartLinkUrlTestCase } from './edit';
|
|
4
|
+
import { switchToEmbedSmartLinkTestCase } from './insert';
|
|
5
|
+
export var embedSmartLinksTestCollection = function embedSmartLinksTestCollection(opts) {
|
|
6
|
+
return new InProductTestCollection({
|
|
7
|
+
title: '@atlaskit/editor-core -> Embed Smart Links, happy paths',
|
|
8
|
+
testCases: [switchToEmbedSmartLinkTestCase(opts), editEmbedSmartLinkTitleTestCase(opts), editEmbedSmartLinkUrlTestCase(opts), deleteEmbedSmartLinkTestCase(opts)]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { InProductTestCase } from '@atlaskit/in-product-testing';
|
|
2
|
+
import { embedSmartLinkRendersTestCase } from '@atlaskit/smart-card/in-product';
|
|
3
|
+
import { EditorPageObject } from '../../../../page-objects/Editor';
|
|
4
|
+
import { EditorSmartLinkPageObject } from '../../../../page-objects/EditorSmartLink';
|
|
5
|
+
export var switchToEmbedSmartLinkTestCase = function switchToEmbedSmartLinkTestCase(_ref) {
|
|
6
|
+
var ui = _ref.ui,
|
|
7
|
+
url = _ref.url;
|
|
8
|
+
return new InProductTestCase({
|
|
9
|
+
title: 'switching to an Embed Smart Link works',
|
|
10
|
+
id: 'switch-to-embed',
|
|
11
|
+
assertions: function assertions(cy) {
|
|
12
|
+
var editor = new EditorPageObject(cy);
|
|
13
|
+
var editorWithSmartLinks = new EditorSmartLinkPageObject(cy, editor);
|
|
14
|
+
editorWithSmartLinks.insertSmartLinkByTyping(url);
|
|
15
|
+
editorWithSmartLinks.switchAfterInsert('embed');
|
|
16
|
+
embedSmartLinkRendersTestCase({
|
|
17
|
+
url: url
|
|
18
|
+
}).assertions(cy);
|
|
19
|
+
|
|
20
|
+
if (ui !== null && ui !== void 0 && ui.publishButton) {
|
|
21
|
+
var renderer = editor.publish(ui);
|
|
22
|
+
renderer.expectContentReady();
|
|
23
|
+
embedSmartLinkRendersTestCase({
|
|
24
|
+
url: url
|
|
25
|
+
}).assertions(cy);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { InProductTestCase } from '@atlaskit/in-product-testing';
|
|
2
|
+
import { InlineCardPageObject, inlineSmartLinkRendersTestCase } from '@atlaskit/smart-card/in-product';
|
|
3
|
+
import { EditorPageObject } from '../../../../page-objects/Editor';
|
|
4
|
+
import { EditorSmartLinkPageObject } from '../../../../page-objects/EditorSmartLink';
|
|
5
|
+
export var deleteInlineSmartLinkTestCase = function deleteInlineSmartLinkTestCase(_ref) {
|
|
6
|
+
var ui = _ref.ui,
|
|
7
|
+
url = _ref.url;
|
|
8
|
+
return new InProductTestCase({
|
|
9
|
+
title: 'able to delete an Inline Smart Link using floating toolbar',
|
|
10
|
+
id: 'delete-inline-smart-link',
|
|
11
|
+
assertions: function assertions(cy) {
|
|
12
|
+
var editor = new EditorPageObject(cy);
|
|
13
|
+
var editorWithSmartLinks = new EditorSmartLinkPageObject(cy, editor);
|
|
14
|
+
var inlineCard = new InlineCardPageObject(cy);
|
|
15
|
+
editorWithSmartLinks.insertSmartLinkByTyping(url);
|
|
16
|
+
inlineSmartLinkRendersTestCase({
|
|
17
|
+
url: url
|
|
18
|
+
}).assertions(cy);
|
|
19
|
+
editorWithSmartLinks.deleteSmartLink();
|
|
20
|
+
inlineCard.expectCardNotExists();
|
|
21
|
+
|
|
22
|
+
if (ui !== null && ui !== void 0 && ui.publishButton) {
|
|
23
|
+
var renderer = editor.publish(ui);
|
|
24
|
+
renderer.expectContentReady();
|
|
25
|
+
inlineCard.expectCardNotExists();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { InProductTestCase } from '@atlaskit/in-product-testing';
|
|
2
|
+
import { InlineCardPageObject, inlineSmartLinkRendersTestCase } from '@atlaskit/smart-card/in-product';
|
|
3
|
+
import { EditorPageObject } from '../../../../page-objects/Editor';
|
|
4
|
+
import { EditorSmartLinkPageObject } from '../../../../page-objects/EditorSmartLink';
|
|
5
|
+
export var editInlineSmartLinkTitleTestCase = function editInlineSmartLinkTitleTestCase(_ref) {
|
|
6
|
+
var ui = _ref.ui,
|
|
7
|
+
url = _ref.url;
|
|
8
|
+
return new InProductTestCase({
|
|
9
|
+
title: 'editing an Inline Smart Link renders as Blue Link (title)',
|
|
10
|
+
id: 'inline-smart-link-edit-title',
|
|
11
|
+
assertions: function assertions(cy) {
|
|
12
|
+
var editor = new EditorPageObject(cy);
|
|
13
|
+
var editorWithSmartLinks = new EditorSmartLinkPageObject(cy, editor);
|
|
14
|
+
var inlineCard = new InlineCardPageObject(cy);
|
|
15
|
+
editorWithSmartLinks.insertSmartLinkByTyping(url);
|
|
16
|
+
inlineSmartLinkRendersTestCase({
|
|
17
|
+
url: url
|
|
18
|
+
}).assertions(cy);
|
|
19
|
+
editorWithSmartLinks.changeLinkLabel('Avocorne is watching you 🥑');
|
|
20
|
+
inlineCard.assertHrefRendered(url);
|
|
21
|
+
inlineCard.expectCardNotExists();
|
|
22
|
+
|
|
23
|
+
if (ui !== null && ui !== void 0 && ui.publishButton) {
|
|
24
|
+
var renderer = editor.publish(ui);
|
|
25
|
+
renderer.expectContentReady();
|
|
26
|
+
inlineCard.assertHrefRendered(url);
|
|
27
|
+
inlineCard.expectCardNotExists();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
export var editInlineSmartLinkUrlTestCase = function editInlineSmartLinkUrlTestCase(_ref2) {
|
|
33
|
+
var ui = _ref2.ui,
|
|
34
|
+
url = _ref2.url;
|
|
35
|
+
return new InProductTestCase({
|
|
36
|
+
title: 'editing an Inline Smart Link renders as Blue Link (URL)',
|
|
37
|
+
id: 'inline-smart-link-edit',
|
|
38
|
+
assertions: function assertions(cy) {
|
|
39
|
+
var editor = new EditorPageObject(cy);
|
|
40
|
+
var editorWithSmartLinks = new EditorSmartLinkPageObject(cy, editor);
|
|
41
|
+
var inlineCard = new InlineCardPageObject(cy);
|
|
42
|
+
editorWithSmartLinks.insertSmartLinkByTyping(url);
|
|
43
|
+
inlineSmartLinkRendersTestCase({
|
|
44
|
+
url: url
|
|
45
|
+
}).assertions(cy);
|
|
46
|
+
var newUrl = 'https://avo.corne.com';
|
|
47
|
+
editorWithSmartLinks.changeLinkUrl(newUrl);
|
|
48
|
+
inlineCard.expectCardNotExists();
|
|
49
|
+
inlineCard.assertHrefRendered(newUrl);
|
|
50
|
+
|
|
51
|
+
if (ui !== null && ui !== void 0 && ui.publishButton) {
|
|
52
|
+
var renderer = editor.publish(ui);
|
|
53
|
+
renderer.expectContentReady();
|
|
54
|
+
inlineCard.assertHrefRendered(newUrl);
|
|
55
|
+
inlineCard.expectCardNotExists();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { InProductTestCollection } from '@atlaskit/in-product-testing';
|
|
2
|
+
import { deleteInlineSmartLinkTestCase } from './delete';
|
|
3
|
+
import { editInlineSmartLinkTitleTestCase, editInlineSmartLinkUrlTestCase } from './edit';
|
|
4
|
+
import { insertInlineSmartLinkTestCase } from './insert';
|
|
5
|
+
import { unlinkInlineSmartLinkTestCase } from './unlink';
|
|
6
|
+
export var inlineSmartLinksTestCollection = function inlineSmartLinksTestCollection(opts) {
|
|
7
|
+
return new InProductTestCollection({
|
|
8
|
+
title: '@atlaskit/editor-core -> Inline Smart Links, happy paths',
|
|
9
|
+
testCases: [insertInlineSmartLinkTestCase(opts), editInlineSmartLinkTitleTestCase(opts), editInlineSmartLinkUrlTestCase(opts), unlinkInlineSmartLinkTestCase(opts), deleteInlineSmartLinkTestCase(opts)]
|
|
10
|
+
});
|
|
11
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { InProductTestCase } from '@atlaskit/in-product-testing';
|
|
2
|
+
import { inlineSmartLinkRendersTestCase } from '@atlaskit/smart-card/in-product';
|
|
3
|
+
import { EditorPageObject } from '../../../../page-objects/Editor';
|
|
4
|
+
import { EditorSmartLinkPageObject } from '../../../../page-objects/EditorSmartLink';
|
|
5
|
+
export var insertInlineSmartLinkTestCase = function insertInlineSmartLinkTestCase(_ref) {
|
|
6
|
+
var ui = _ref.ui,
|
|
7
|
+
url = _ref.url;
|
|
8
|
+
return new InProductTestCase({
|
|
9
|
+
title: 'inserting an Inline Smart Link works',
|
|
10
|
+
id: 'inline-smart-link-insert',
|
|
11
|
+
assertions: function assertions(cy) {
|
|
12
|
+
var editor = new EditorPageObject(cy);
|
|
13
|
+
var editorWithSmartLinks = new EditorSmartLinkPageObject(cy, editor);
|
|
14
|
+
editorWithSmartLinks.insertSmartLinkByTyping(url);
|
|
15
|
+
inlineSmartLinkRendersTestCase({
|
|
16
|
+
url: url
|
|
17
|
+
}).assertions(cy);
|
|
18
|
+
|
|
19
|
+
if (ui !== null && ui !== void 0 && ui.publishButton) {
|
|
20
|
+
var renderer = editor.publish(ui);
|
|
21
|
+
renderer.expectContentReady();
|
|
22
|
+
inlineSmartLinkRendersTestCase({
|
|
23
|
+
url: url
|
|
24
|
+
}).assertions(cy);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { InProductTestCase } from '@atlaskit/in-product-testing';
|
|
2
|
+
import { InlineCardPageObject, inlineSmartLinkRendersTestCase } from '@atlaskit/smart-card/in-product';
|
|
3
|
+
import { EditorPageObject } from '../../../../page-objects/Editor';
|
|
4
|
+
import { EditorSmartLinkPageObject } from '../../../../page-objects/EditorSmartLink';
|
|
5
|
+
export var unlinkInlineSmartLinkTestCase = function unlinkInlineSmartLinkTestCase(_ref) {
|
|
6
|
+
var ui = _ref.ui,
|
|
7
|
+
url = _ref.url;
|
|
8
|
+
return new InProductTestCase({
|
|
9
|
+
title: 'unlinking an Inline Smart Link works',
|
|
10
|
+
id: 'inline-smart-link-unlink',
|
|
11
|
+
assertions: function assertions(cy) {
|
|
12
|
+
var editor = new EditorPageObject(cy);
|
|
13
|
+
var editorWithSmartLinks = new EditorSmartLinkPageObject(cy, editor);
|
|
14
|
+
var inlineCard = new InlineCardPageObject(cy);
|
|
15
|
+
editorWithSmartLinks.insertSmartLinkByTyping(url);
|
|
16
|
+
inlineSmartLinkRendersTestCase({
|
|
17
|
+
url: url
|
|
18
|
+
}).assertions(cy);
|
|
19
|
+
editorWithSmartLinks.unlink();
|
|
20
|
+
inlineCard.expectCardNotExists();
|
|
21
|
+
inlineCard.assertHrefNotRendered(url);
|
|
22
|
+
|
|
23
|
+
if (ui !== null && ui !== void 0 && ui.publishButton) {
|
|
24
|
+
var renderer = editor.publish(ui);
|
|
25
|
+
renderer.expectContentReady();
|
|
26
|
+
inlineCard.expectCardNotExists();
|
|
27
|
+
inlineCard.assertHrefNotRendered(url);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { InProductTestCollection } from '@atlaskit/in-product-testing';
|
|
2
|
+
import { switchToUrlTestCase } from './insert';
|
|
3
|
+
export var blueLinksTestCollection = function blueLinksTestCollection(opts) {
|
|
4
|
+
return new InProductTestCollection({
|
|
5
|
+
title: '@atlaskit/editor-core -> Blue Links, happy paths',
|
|
6
|
+
testCases: [switchToUrlTestCase(opts)]
|
|
7
|
+
});
|
|
8
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { InProductTestCase } from '@atlaskit/in-product-testing';
|
|
2
|
+
import { InlineCardPageObject } from '@atlaskit/smart-card/in-product';
|
|
3
|
+
import { EditorPageObject } from '../../../../page-objects/Editor';
|
|
4
|
+
import { EditorSmartLinkPageObject } from '../../../../page-objects/EditorSmartLink';
|
|
5
|
+
export var switchToUrlTestCase = function switchToUrlTestCase(_ref) {
|
|
6
|
+
var ui = _ref.ui,
|
|
7
|
+
url = _ref.url;
|
|
8
|
+
return new InProductTestCase({
|
|
9
|
+
title: 'switching to a Blue Link works',
|
|
10
|
+
id: 'switch-to-url',
|
|
11
|
+
assertions: function assertions(cy) {
|
|
12
|
+
var editor = new EditorPageObject(cy);
|
|
13
|
+
var editorWithSmartLinks = new EditorSmartLinkPageObject(cy, editor);
|
|
14
|
+
var inlineCard = new InlineCardPageObject(cy);
|
|
15
|
+
editorWithSmartLinks.insertSmartLinkByTyping(url);
|
|
16
|
+
editorWithSmartLinks.switchAfterInsert('url');
|
|
17
|
+
inlineCard.assertHrefRendered(url);
|
|
18
|
+
|
|
19
|
+
if (ui !== null && ui !== void 0 && ui.publishButton) {
|
|
20
|
+
var renderer = editor.publish(ui);
|
|
21
|
+
renderer.expectContentReady();
|
|
22
|
+
inlineCard.assertHrefRendered(url);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { EditorPageObject } from './page-objects/Editor';
|
|
2
|
+
export { fundamentalsTestCollection } from './cases/fundamentals/collection';
|
|
3
|
+
export { inlineSmartLinksTestCollection, blockSmartLinksTestCollection, embedSmartLinksTestCollection, blueLinksTestCollection } from './cases/smart-links';
|
|
4
|
+
export { mediaTestCollection } from './cases/media/test-cases';
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
4
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
|
+
|
|
7
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
8
|
+
|
|
9
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
10
|
+
|
|
11
|
+
import { InProductTestPageObject } from '@atlaskit/in-product-testing';
|
|
12
|
+
import { RendererPageObject } from './Renderer';
|
|
13
|
+
export var EditorPageObject = /*#__PURE__*/function (_InProductTestPageObj) {
|
|
14
|
+
_inherits(EditorPageObject, _InProductTestPageObj);
|
|
15
|
+
|
|
16
|
+
var _super = _createSuper(EditorPageObject);
|
|
17
|
+
|
|
18
|
+
function EditorPageObject() {
|
|
19
|
+
_classCallCheck(this, EditorPageObject);
|
|
20
|
+
|
|
21
|
+
return _super.apply(this, arguments);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
_createClass(EditorPageObject, [{
|
|
25
|
+
key: "getEditorArea",
|
|
26
|
+
value: function getEditorArea() {
|
|
27
|
+
return this.cy.get('div.ProseMirror', {
|
|
28
|
+
timeout: 30000
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}, {
|
|
32
|
+
key: "getTitleArea",
|
|
33
|
+
value: function getTitleArea() {
|
|
34
|
+
return this.cy.get('[data-test-id="editor-title"]');
|
|
35
|
+
}
|
|
36
|
+
}, {
|
|
37
|
+
key: "publish",
|
|
38
|
+
value: function publish(opts) {
|
|
39
|
+
if (opts !== null && opts !== void 0 && opts.publishButton) {
|
|
40
|
+
this.cy.get(opts.publishButton).click();
|
|
41
|
+
return new RendererPageObject(this.cy);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
throw Error('No publish button selector supplied!');
|
|
45
|
+
}
|
|
46
|
+
}, {
|
|
47
|
+
key: "upload",
|
|
48
|
+
value: function upload(fixtures) {
|
|
49
|
+
return this.getEditorArea().attachFile(fixtures, {
|
|
50
|
+
subjectType: 'drag-n-drop'
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}]);
|
|
54
|
+
|
|
55
|
+
return EditorPageObject;
|
|
56
|
+
}(InProductTestPageObject);
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
+
|
|
9
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
+
|
|
11
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
|
+
|
|
13
|
+
import { InProductTestPageObject } from '@atlaskit/in-product-testing';
|
|
14
|
+
import { MediaCardPageObject } from '@atlaskit/media-card/in-product';
|
|
15
|
+
export var EditorMediaPageObject = /*#__PURE__*/function (_InProductTestPageObj) {
|
|
16
|
+
_inherits(EditorMediaPageObject, _InProductTestPageObj);
|
|
17
|
+
|
|
18
|
+
var _super = _createSuper(EditorMediaPageObject);
|
|
19
|
+
|
|
20
|
+
function EditorMediaPageObject(cy) {
|
|
21
|
+
var _this;
|
|
22
|
+
|
|
23
|
+
_classCallCheck(this, EditorMediaPageObject);
|
|
24
|
+
|
|
25
|
+
_this = _super.call(this, cy);
|
|
26
|
+
|
|
27
|
+
_defineProperty(_assertThisInitialized(_this), "testIds", {
|
|
28
|
+
altTextButton: 'alt-text-edit-button',
|
|
29
|
+
altTextInput: 'alt-text-input',
|
|
30
|
+
captionPlaceholder: 'caption-placeholder',
|
|
31
|
+
caption: 'media-caption'
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
_this.cy = cy;
|
|
35
|
+
return _this;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
_createClass(EditorMediaPageObject, [{
|
|
39
|
+
key: "addAltTextToImage",
|
|
40
|
+
value: function addAltTextToImage(altText) {
|
|
41
|
+
var cardNumber = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
42
|
+
var mediaCard = new MediaCardPageObject(this.cy);
|
|
43
|
+
mediaCard.findCardNth(cardNumber).click();
|
|
44
|
+
this.getAltTextButton().click();
|
|
45
|
+
this.getAltTextInput().type("".concat(altText, "{enter}"));
|
|
46
|
+
}
|
|
47
|
+
}, {
|
|
48
|
+
key: "addCaptionToImage",
|
|
49
|
+
value: function addCaptionToImage(captionText) {
|
|
50
|
+
var cardNumber = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
51
|
+
var mediaCard = new MediaCardPageObject(this.cy);
|
|
52
|
+
mediaCard.findCardNth(cardNumber).click();
|
|
53
|
+
this.getCaptionInput().type("".concat(captionText, "{enter}"));
|
|
54
|
+
}
|
|
55
|
+
}, {
|
|
56
|
+
key: "assertCaptionText",
|
|
57
|
+
value: function assertCaptionText(captionText) {
|
|
58
|
+
return this.cy.get(this.toTestId(this.testIds.caption)).should('have.text', captionText);
|
|
59
|
+
}
|
|
60
|
+
}, {
|
|
61
|
+
key: "assertAltText",
|
|
62
|
+
value: function assertAltText(altText) {
|
|
63
|
+
return this.cy.get('.mediaView-content-wrap').should('have.attr', 'alt', altText);
|
|
64
|
+
}
|
|
65
|
+
}, {
|
|
66
|
+
key: "getAltTextButton",
|
|
67
|
+
value: function getAltTextButton() {
|
|
68
|
+
return this.cy.get(this.toTestId(this.testIds.altTextButton)).should('be.visible');
|
|
69
|
+
}
|
|
70
|
+
}, {
|
|
71
|
+
key: "getAltTextInput",
|
|
72
|
+
value: function getAltTextInput() {
|
|
73
|
+
return this.cy.get(this.toTestId(this.testIds.altTextInput)).should('be.visible');
|
|
74
|
+
}
|
|
75
|
+
}, {
|
|
76
|
+
key: "getCaptionInput",
|
|
77
|
+
value: function getCaptionInput() {
|
|
78
|
+
return this.cy.get(this.toTestId(this.testIds.captionPlaceholder)).should('be.visible');
|
|
79
|
+
}
|
|
80
|
+
}]);
|
|
81
|
+
|
|
82
|
+
return EditorMediaPageObject;
|
|
83
|
+
}(InProductTestPageObject);
|