From 0780caf2eabd8a80b1443329680e5aa0101d81b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benedikt=20R=C3=B6tsch?= Date: Tue, 27 Apr 2021 13:00:35 +0200 Subject: [PATCH 1/5] tests: only allow retry for image tests --- e2e-tests/contentful/cypress.json | 2 +- .../cypress/integration/gatsby-image.js | 17 ++++++--- .../integration/gatsby-plugin-image.js | 35 ++++++++++++++----- 3 files changed, 39 insertions(+), 15 deletions(-) diff --git a/e2e-tests/contentful/cypress.json b/e2e-tests/contentful/cypress.json index 39598f8798b12..b1ab75eaa46f7 100644 --- a/e2e-tests/contentful/cypress.json +++ b/e2e-tests/contentful/cypress.json @@ -1,7 +1,7 @@ { "baseUrl": "http://localhost:9000", "retries": { - "runMode": 2, + "runMode": 0, "openMode": 0 }, "viewportWidth": 1440, diff --git a/e2e-tests/contentful/cypress/integration/gatsby-image.js b/e2e-tests/contentful/cypress/integration/gatsby-image.js index 14f49dd6d874a..a4136c2868551 100644 --- a/e2e-tests/contentful/cypress/integration/gatsby-image.js +++ b/e2e-tests/contentful/cypress/integration/gatsby-image.js @@ -1,3 +1,10 @@ +const testConfig = { + retries: { + runMode: 2, + openMode: 0, + }, +} + function hasSVGPlaceholder(el) { el.children(`img`) .should(`have.attr`, `src`) @@ -41,9 +48,9 @@ describe(`gatsby-image`, () => { beforeEach(() => { cy.visit("/gatsby-image").waitForRouteChange() }) - it(`fluid`, () => testGatsbyImage(`fluid`, hasJPEGPlaceholder)) - it(`fixed`, () => testGatsbyImage(`fixed`, hasJPEGPlaceholder)) - it(`webp`, () => testGatsbyImage(`webp`, hasJPEGPlaceholder)) - it(`traced`, () => testGatsbyImage(`traced`, hasSVGPlaceholder)) - it(`sqip`, () => testGatsbyImage(`sqip`, hasSVGPlaceholder)) + it(`fluid`, testConfig, () => testGatsbyImage(`fluid`, hasJPEGPlaceholder)) + it(`fixed`, testConfig, () => testGatsbyImage(`fixed`, hasJPEGPlaceholder)) + it(`webp`, testConfig, () => testGatsbyImage(`webp`, hasJPEGPlaceholder)) + it(`traced`, testConfig, () => testGatsbyImage(`traced`, hasSVGPlaceholder)) + it(`sqip`, testConfig, () => testGatsbyImage(`sqip`, hasSVGPlaceholder)) }) diff --git a/e2e-tests/contentful/cypress/integration/gatsby-plugin-image.js b/e2e-tests/contentful/cypress/integration/gatsby-plugin-image.js index a4e60f7bce737..3ad283ea8a9aa 100644 --- a/e2e-tests/contentful/cypress/integration/gatsby-plugin-image.js +++ b/e2e-tests/contentful/cypress/integration/gatsby-plugin-image.js @@ -1,3 +1,10 @@ +const testConfig = { + retries: { + runMode: 2, + openMode: 0, + }, +} + function hasSVGPlaceholder(el) { el.find(`img`) .should(`have.attr`, `src`) @@ -54,13 +61,23 @@ describe(`gatsby-plugin-image`, () => { cy.visit("/gatsby-plugin-image").waitForRouteChange() }) - it(`constrained`, () => - testGatsbyPluginImage(`constrained`, hasColorPlaceholder)) - it(`full-width`, () => testGatsbyPluginImage(`full-width`, hasNoPlaceholder)) - it(`fixed`, () => testGatsbyPluginImage(`fixed`, hasNoPlaceholder)) - it(`dominant-color`, () => - testGatsbyPluginImage(`dominant-color`, hasColorPlaceholder)) - it(`traced`, () => testGatsbyPluginImage(`traced`, hasSVGPlaceholder)) - it(`blurred`, () => testGatsbyPluginImage(`blurred`, hasJPEGPlaceholder)) - it(`sqip`, () => testGatsbyPluginImage(`sqip`, hasSVGPlaceholder)) + it(`constrained`, testConfig, () => + testGatsbyPluginImage(`constrained`, hasColorPlaceholder) + ) + it(`full-width`, testConfig, () => + testGatsbyPluginImage(`full-width`, hasNoPlaceholder) + ) + it(`fixed`, testConfig, () => + testGatsbyPluginImage(`fixed`, hasNoPlaceholder) + ) + it(`dominant-color`, testConfig, () => + testGatsbyPluginImage(`dominant-color`, hasColorPlaceholder) + ) + it(`traced`, testConfig, () => + testGatsbyPluginImage(`traced`, hasSVGPlaceholder) + ) + it(`blurred`, testConfig, () => + testGatsbyPluginImage(`blurred`, hasJPEGPlaceholder) + ) + it(`sqip`, testConfig, () => testGatsbyPluginImage(`sqip`, hasSVGPlaceholder)) }) From 055c5f24bd69023554900b933764df51a9415a0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benedikt=20R=C3=B6tsch?= Date: Tue, 27 Apr 2021 15:41:55 +0200 Subject: [PATCH 2/5] tests: update snapshots based on changes of html rendering --- e2e-tests/contentful/snapshots.js | 38 +++++++++++++++---------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/e2e-tests/contentful/snapshots.js b/e2e-tests/contentful/snapshots.js index fd6075bc45298..e5fef239f4e87 100644 --- a/e2e-tests/contentful/snapshots.js +++ b/e2e-tests/contentful/snapshots.js @@ -1,58 +1,58 @@ module.exports = { "content-reference": { "content-reference-many-2nd-level-loop": { - "1": "
\n

Content Reference: Many (2nd level loop)

\n

[ContentfulInteger] 42

\n

[ContentfulText] The quick brown fox jumps over the lazy\n dog.

\n

[ContentfulReference] Content Reference: One (Loop A\n -> B): [Content Reference: One (Loop B -> A)]

\n
" + "1": "
\n

Content Reference: Many (2nd level loop)

\n

[ContentfulInteger]\n 42

\n

[ContentfulText]\n The quick brown fox jumps over the lazy dog.

\n

[ContentfulReference]\n Content Reference: One (Loop A -> B)\n : [\n Content Reference: One (Loop B -> A)\n ]

\n
" }, "content-reference-many-loop-a-greater-b": { - "1": "
\n

Content Reference: Many (Loop A -> B)

\n

[ContentfulInteger] 42

\n

[ContentfulText] The quick brown fox jumps over the lazy\n dog.

\n

[ContentfulReference] Content Reference: Many (Loop\n B -> A): [Number: Integer, Text: Short, Content Reference: Many (Loop A\n -> B)]

\n
" + "1": "
\n

Content Reference: Many (Loop A -> B)

\n

[ContentfulInteger]\n 42

\n

[ContentfulText]\n The quick brown fox jumps over the lazy dog.

\n

[ContentfulReference]\n Content Reference: Many (Loop B -> A)\n : [\n Number: Integer, Text: Short, Content Reference: Many (Loop A ->\n B)\n ]

\n
" }, "content-reference-many-loop-b-greater-a": { - "1": "
\n

Content Reference: Many (Loop B -> A)

\n

[ContentfulInteger] 42

\n

[ContentfulText] The quick brown fox jumps over the lazy\n dog.

\n

[ContentfulReference] Content Reference: Many (Loop\n A -> B): [Number: Integer, Text: Short, Content Reference: Many (Loop B\n -> A)]

\n
" + "1": "
\n

Content Reference: Many (Loop B -> A)

\n

[ContentfulInteger]\n 42

\n

[ContentfulText]\n The quick brown fox jumps over the lazy dog.

\n

[ContentfulReference]\n Content Reference: Many (Loop A -> B)\n : [\n Number: Integer, Text: Short, Content Reference: Many (Loop B ->\n A)\n ]

\n
" }, "content-reference-many-self-reference": { - "1": "
\n

Content Reference: Many (Self Reference)

\n

[ContentfulInteger] 42

\n

[ContentfulText] The quick brown fox jumps over the lazy\n dog.

\n

[ContentfulReference] Content Reference: Many (Self\n Reference): [Number: Integer, Text: Short, Content Reference: Many (Self\n Reference)]

\n
" + "1": "
\n

Content Reference: Many (Self Reference)

\n

[ContentfulInteger]\n 42

\n

[ContentfulText]\n The quick brown fox jumps over the lazy dog.

\n

[ContentfulReference]\n Content Reference: Many (Self Reference)\n : [\n Number: Integer, Text: Short, Content Reference: Many (Self\n Reference)\n ]

\n
" }, "content-reference-one": { - "1": "
\n

Content Reference: One

\n

[ContentfulText] The quick brown fox jumps over the lazy\n dog.

\n
" + "1": "
\n

Content Reference: One

\n

[ContentfulText]\n The quick brown fox jumps over the lazy dog.

\n
" }, "content-reference-one-loop-a-greater-b": { - "1": "
\n

Content Reference: One (Loop A -> B)

\n

[ContentfulReference] Content Reference: One (Loop B\n -> A): [Content Reference: One (Loop A -> B)]

\n
" + "1": "
\n

Content Reference: One (Loop A -> B)

\n

[ContentfulReference]\n Content Reference: One (Loop B -> A)\n : [\n Content Reference: One (Loop A -> B)\n ]

\n
" }, "content-reference-one-loop-b-greater-a": { - "1": "
\n

Content Reference: One (Loop B -> A)

\n

[ContentfulReference] Content Reference: One (Loop A\n -> B): [Content Reference: One (Loop B -> A)]

\n
" + "1": "
\n

Content Reference: One (Loop B -> A)

\n

[ContentfulReference]\n Content Reference: One (Loop A -> B)\n : [\n Content Reference: One (Loop B -> A)\n ]

\n
" }, "content-reference-one-self-reference": { - "1": "
\n

Content Reference: One (Self Reference)

\n

[ContentfulReference] Content Reference: One (Self\n Reference): [Content Reference: One (Self Reference)]

\n
" + "1": "
\n

Content Reference: One (Self Reference)

\n

[ContentfulReference]\n Content Reference: One (Self Reference)\n : [\n Content Reference: One (Self Reference)\n ]

\n
" } }, "__version": "6.8.0", "rich-text": { "rich-text: All Features": { - "1": "
\n

Rich Text: All Features

\n

The European languages

\n

are members of the same family. Their separate existence is a myth. For:

\n
    \n
  • \n

    science

    \n
  • \n
  • \n

    music

    \n
  • \n
  • \n

    sport

    \n
  • \n
  • \n

    etc

    \n
  • \n
\n

Europe uses the same vocabulary.

\n
\n
\"\"\n\n \n \n \n
\n

\n
\n

The languages only differ in:

\n
    \n
  1. \n

    their grammar

    \n
  2. \n
  3. \n

    their pronunciation

    \n
  4. \n
  5. \n

    their most common words

    \n
  6. \n
  7. \n

    [Inline-ContentfulText] Text: Short: The\n quick brown fox jumps over the lazy dog.

    \n
  8. \n
\n

Everyone realizes why a new common language would be desirable: one could\n refuse to pay expensive translators.

\n

{\n \"userId\": 1,\n \"id\": 1,\n \"title\": \"delectus aut autem\",\n \"completed\": false\n }

\n

To achieve this, it would be necessary to have uniform grammar,\n pronunciation and more common words.

\n

[ContentfulLocation] Lat: 52.51627, Long: 13.3777

\n
\n

If several languages coalesce, the grammar of the resulting language is\n more simple and regular than that of the individual languages.

\n
\n

The new common language will be more simple and regular than the existing\n European languages. It will be as simple as Occidental; in fact, it will be\n

\n
\n
" + "1": "
\n

Rich Text: All Features

\n

The European languages

\n

are members of the same family. Their separate existence is a myth. For:

\n
    \n
  • \n

    science

    \n
  • \n
  • \n

    music

    \n
  • \n
  • \n

    sport

    \n
  • \n
  • \n

    etc

    \n
  • \n
\n

Europe uses the same vocabulary.

\n
\n
\"\"\n\n
\n

\n
\n

The languages only differ in:

\n
    \n
  1. \n

    their grammar

    \n
  2. \n
  3. \n

    their pronunciation

    \n
  4. \n
  5. \n

    their most common words

    \n
  6. \n
  7. \n

    [Inline-ContentfulText]\n Text: Short\n :\n The quick brown fox jumps over the lazy dog.

    \n
  8. \n
\n

Everyone realizes why a new common language would be desirable: one could\n refuse to pay expensive translators.

\n

{\n \"userId\": 1,\n \"id\": 1,\n \"title\": \"delectus aut autem\",\n \"completed\": false\n }

\n

To achieve this, it would be necessary to have uniform grammar,\n pronunciation and more common words.

\n

[ContentfulLocation] Lat:\n 52.51627\n , Long:\n 13.3777

\n
\n

If several languages coalesce, the grammar of the resulting language is\n more simple and regular than that of the individual languages.

\n
\n

The new common language will be more simple and regular than the existing\n European languages. It will be as simple as Occidental; in fact, it will be\n

\n
\n
" }, "rich-text: Basic": { "1": "
\n

Rich Text: Basic

\n

The European languages

\n

are members of the same family. Their separate existence is a myth. For:

\n
    \n
  • \n

    science

    \n
  • \n
  • \n

    music

    \n
  • \n
  • \n

    sport

    \n
  • \n
  • \n

    etc

    \n
  • \n
\n

Europe uses the same vocabulary.

\n
\n

The languages only differ in:

\n
    \n
  1. \n

    their grammar

    \n
  2. \n
  3. \n

    their pronunciation

    \n
  4. \n
  5. \n

    their most common words

    \n
  6. \n
\n

Everyone realizes why a new common language would be desirable: one could\n refuse to pay expensive translators.

\n

{\n \"userId\": 1,\n \"id\": 1,\n \"title\": \"delectus aut autem\",\n \"completed\": false\n }

\n

To achieve this, it would be necessary to have uniform grammar,\n pronunciation and more common words.

\n
\n

If several languages coalesce, the grammar of the resulting language is\n more simple and regular than that of the individual languages.

\n
\n

The new common language will be more simple and regular than the existing\n European languages. It will be as simple as Occidental; in fact, it will be\n

\n
\n
" }, "rich-text: Embedded Entry": { - "1": "
\n

Rich Text: Embedded Entry

\n

Embedded Entry

\n

[ContentfulText] The quick brown fox jumps over the lazy\n dog.

\n

\n

\n
\n
" + "1": "
\n

Rich Text: Embedded Entry

\n

Embedded Entry

\n

[ContentfulText]\n The quick brown fox jumps over the lazy dog.

\n

\n

\n
\n
" }, "rich-text: Embedded Asset": { - "1": "
\n

Rich Text: Embedded asset

\n

Embedded Asset

\n
\n
\n \n \n \n
\n

\n

\n

\n
\n
" + "1": "
\n

Rich Text: Embedded asset

\n

Embedded Asset

\n
\n
\n
\n

\n

\n

\n
\n
" }, "rich-text: Embedded Entry With Deep Reference Loop": { - "1": "
\n

Rich Text: Embedded entry with deep reference loop

\n

Embedded entry with deep reference loop

\n

[ContentfulReference] Content Reference: Many (2nd\n level loop): [Number: Integer, Text: Short, Content Reference: One (Loop A\n -> B)]

\n

\n

\n
\n
" + "1": "
\n

Rich Text: Embedded entry with deep reference loop

\n

Embedded entry with deep reference loop

\n

[ContentfulReference]\n Content Reference: Many (2nd level loop)\n : [\n Number: Integer, Text: Short, Content Reference: One (Loop A ->\n B)\n ]

\n

\n

\n
\n
" }, "rich-text: Embedded Entry With Reference Loop": { - "1": "
\n

Rich Text: Embedded entry with reference loop

\n

Embedded entry with reference loop

\n

[ContentfulReference] Content Reference: One (Loop B\n -> A): [Content Reference: One (Loop A -> B)]

\n

\n
\n
" + "1": "
\n

Rich Text: Embedded entry with reference loop

\n

Embedded entry with reference loop

\n

[ContentfulReference]\n Content Reference: One (Loop B -> A)\n : [\n Content Reference: One (Loop A -> B)\n ]

\n

\n
\n
" }, "rich-text: Inline Entry": { - "1": "
\n

Rich Text: Inline entry

\n

Inline entry with reference loop

\n

Should be rendered after this [Inline-ContentfulText] Text: Short: The quick\n brown fox jumps over the lazy dog. and before that

\n

\n

\n
\n
" + "1": "
\n

Rich Text: Inline entry

\n

Inline entry with reference loop

\n

Should be rendered after this [Inline-ContentfulText]\n Text: Short\n :\n The quick brown fox jumps over the lazy dog. and before\n that

\n

\n

\n
\n
" }, "rich-text: Inline Entry With Deep Reference Loop": { - "1": "
\n

Rich Text: Inline entry with deep reference loop

\n

Inline entry with deep reference loop

\n

Should be rendered after this [Inline-ContentfulContentReference]\n Content Reference: Many (2nd level loop) and before that

\n

\n

\n
\n
" + "1": "
\n

Rich Text: Inline entry with deep reference loop

\n

Inline entry with deep reference loop

\n

Should be rendered after this [Inline-\n ContentfulContentReference\n ]\n Content Reference: Many (2nd level loop) and before that\n

\n

\n

\n
\n
" }, "rich-text: Inline Entry With Reference Loop": { - "1": "
\n

Rich Text: Inline entry with reference loop

\n

Inline entry with reference loop

\n

Should be rendered after this [Inline-ContentfulContentReference]\n Content Reference: One (Loop A -> B) and before that

\n

\n

\n
\n
" + "1": "
\n

Rich Text: Inline entry with reference loop

\n

Inline entry with reference loop

\n

Should be rendered after this [Inline-\n ContentfulContentReference\n ]\n Content Reference: One (Loop A -> B) and before that

\n

\n

\n
\n
" } }, "text": { @@ -63,13 +63,13 @@ module.exports = { "1": "
\n

Headline

\n

The European languages are members of the same family.\n Their separate existence is a myth. For:

\n
    \n
  • science
  • \n
  • music
  • \n
  • sport
  • \n
  • etc
  • \n
\n

Europe uses the same vocabulary.

\n
\n

The languages only differ in their grammar, their pronunciation and their\n most common words. Everyone realizes why a new common language would be\n desirable: one could refuse to pay expensive translators.

\n
\n

To achieve this, it would be necessary to have uniform grammar,\n pronunciation and more common words. If several languages coalesce, the\n grammar of the resulting language is more simple and regular than that of\n the individual languages. The new common language will be more simple and\n regular than the existing European languages. It will be as simple as\n Occidental; in fact, it will be.

\n
" }, "text: Long Markdown Complex": { - "1": "
\n

Headline Complex

\n

The European languages are members of the same family. Their\n separate existence is a myth. For:

\n
    \n
  • science
  • \n
  • music
  • \n
  • sport
  • \n
  • etc
  • \n
\n

Europe uses the same vocabulary.

\n
\n

The languages only differ in their grammar, their pronunciation and their\n most common words. Everyone realizes why a new common language would be\n desirable: one could refuse to pay expensive translators.

\n
\n

\n

To achieve this, it would be necessary to have uniform grammar,\n pronunciation and more common words. If several languages coalesce, the\n grammar of the resulting language is more simple and regular than that of\n the individual languages. The new common language will be more simple and\n regular than the existing European languages. It will be as simple as\n Occidental; in fact, it will be.

\n
{\n    \"userId\": 1,\n    \"id\": 1,\n    \"title\": \"delectus aut autem\",\n    \"completed\": false\n}\n
\n
" + "1": "
\n

Headline Complex

\n

The European languages are members of the same family. Their\n separate existence is a myth. For:

\n
    \n
  • science
  • \n
  • music
  • \n
  • sport
  • \n
  • etc
  • \n
\n

Europe uses the same vocabulary.

\n
\n

The languages only differ in their grammar, their pronunciation and their\n most common words. Everyone realizes why a new common language would be\n desirable: one could refuse to pay expensive translators.

\n
\n

\n

To achieve this, it would be necessary to have uniform grammar,\n pronunciation and more common words. If several languages coalesce, the\n grammar of the resulting language is more simple and regular than that of\n the individual languages. The new common language will be more simple and\n regular than the existing European languages. It will be as simple as\n Occidental; in fact, it will be.

\n
{\n\t\"userId\": 1,\n\t\"id\": 1,\n\t\"title\": \"delectus aut autem\",\n\t\"completed\": false\n}\n
\n
" } }, "json": { "json: Complex": { - "1": "
\n

Name: Tom Cruise

\n

Photo:\n https://jsonformatter.org/img/tom-cruise.jpg

\n

Birthdate: 1962-7-3T00:12:34.000Z

\n

Born at: Syracuse, NY

\n

Weight: 67.5

\n

Age: 56

\n

Wife:

\n

Children: Suri, Isabella Jane, Connor

\n

Has children: true

\n

Has grey hair: false

\n
", - "2": "
\n

Name: Robert Downey Jr.

\n

Photo:\n https://jsonformatter.org/img/Robert-Downey-Jr.jpg

\n

Birthdate: 1965-4-4T00:12:34.000Z

\n

Born at: New York City, NY

\n

Weight: 77.1

\n

Age: 53

\n

Wife: Susan Downey

\n

Children: Indio Falconer, Avri Roel, Exton\n Elias

\n

Has children: true

\n

Has grey hair: false

\n
" + "1": "
\n

Name:\n Tom Cruise

\n

Photo:\n https://jsonformatter.org/img/tom-cruise.jpg

\n

Birthdate:\n 1962-7-3T00:12:34.000Z

\n

Born at:\n Syracuse, NY

\n

Weight:\n 67.5

\n

Age:\n 56

\n

Wife:

\n

Children:\n Suri, Isabella Jane, Connor

\n

Has children:\n true

\n

Has grey hair:\n false

\n
", + "2": "
\n

Name:\n Robert Downey Jr.

\n

Photo:\n https://jsonformatter.org/img/Robert-Downey-Jr.jpg

\n

Birthdate:\n 1965-4-4T00:12:34.000Z

\n

Born at:\n New York City, NY

\n

Weight:\n 77.1

\n

Age:\n 53

\n

Wife:\n Susan Downey

\n

Children:\n Indio Falconer, Avri Roel, Exton Elias

\n

Has children:\n true

\n

Has grey hair:\n false

\n
" } } } From a0cb24957d2929168865388567afbc4f260bc334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benedikt=20R=C3=B6tsch?= Date: Tue, 27 Apr 2021 15:56:10 +0200 Subject: [PATCH 3/5] test(e2e-contentful): upgrade gatsby plugins --- e2e-tests/contentful/package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/e2e-tests/contentful/package.json b/e2e-tests/contentful/package.json index 692d092ae4136..03d23a2dcd510 100644 --- a/e2e-tests/contentful/package.json +++ b/e2e-tests/contentful/package.json @@ -8,13 +8,13 @@ "cypress": "^6.8.0", "cypress-image-snapshot": "^4.0.1", "gatsby": "^3.1.1", - "gatsby-image": "^3.1.0", - "gatsby-plugin-image": "^1.1.1", + "gatsby-image": "^3.3.0", + "gatsby-plugin-image": "^1.3.1", "gatsby-plugin-sharp": "^3.1.2", "gatsby-source-contentful": "^5.1.1", - "gatsby-transformer-remark": "^3.2.0", + "gatsby-transformer-remark": "^4.0.0", "gatsby-transformer-sharp": "^3.3.0", - "gatsby-transformer-sqip": "3.1.1", + "gatsby-transformer-sqip": "3.3.1", "modern-normalize": "^1.0.0", "prop-types": "^15.7.2", "react": "^17.0.1", From be1b54993c9e8b54fed95b6ae8bf9be12e51e195 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benedikt=20R=C3=B6tsch?= Date: Wed, 12 May 2021 17:52:48 +0200 Subject: [PATCH 4/5] test(contentful): update schema.sql --- e2e-tests/contentful/schema.gql | 80 ++++++++++++++++----------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/e2e-tests/contentful/schema.gql b/e2e-tests/contentful/schema.gql index 04a295fdccd87..f9a4742d433a4 100644 --- a/e2e-tests/contentful/schema.gql +++ b/e2e-tests/contentful/schema.gql @@ -1,4 +1,4 @@ -### Type definitions saved at 2021-04-27T13:44:24.013Z ### +### Type definitions saved at 2021-05-12T15:50:31.482Z ### type File implements Node @dontInfer { sourceInstanceName: String! @@ -125,7 +125,7 @@ type MarkdownWordCount { words: Int } -type MarkdownRemark implements Node @childOf(mimeTypes: ["text/markdown", "text/x-markdown"], types: ["contentfulTextLongPlainTextNode", "contentfulTextLongMarkdownTextNode"]) @derivedTypes @dontInfer { +type MarkdownRemark implements Node @childOf(mimeTypes: ["text/markdown", "text/x-markdown"], types: ["contentfulTextLongPlainTextNode", "contentfulTextLongMarkdownTextNode"]) @dontInfer { frontmatter: MarkdownRemarkFrontmatter excerpt: String rawMarkdownBody: String @@ -146,7 +146,7 @@ interface ContentfulReference { id: ID! } -type ContentfulAsset implements ContentfulReference & Node @derivedTypes @dontInfer { +type ContentfulAsset implements ContentfulReference & Node @dontInfer { contentful_id: String! spaceId: String createdAt: Date @dateformat @@ -158,14 +158,14 @@ type ContentfulAsset implements ContentfulReference & Node @derivedTypes @dontIn sys: ContentfulAssetSys } -type ContentfulAssetFile @derivedTypes { +type ContentfulAssetFile { url: String details: ContentfulAssetFileDetails fileName: String contentType: String } -type ContentfulAssetFileDetails @derivedTypes { +type ContentfulAssetFileDetails { size: Int image: ContentfulAssetFileDetailsImage } @@ -180,12 +180,12 @@ type ContentfulAssetSys { revision: Int } -type ContentfulNumber implements ContentfulReference & ContentfulEntry & Node @derivedTypes @dontInfer { +type ContentfulNumber implements ContentfulReference & ContentfulEntry & Node @dontInfer { contentful_id: String! node_locale: String! title: String integer: Int - content_reference: [ContentfulContentReference] @link(by: "id", from: "content reference___NODE") @proxy(from: "content reference___NODE") + content_reference: [ContentfulContentReference] @link(by: "id", from: "content reference___NODE") @proxy(from: "content reference___NODE", fromNode: false) spaceId: String createdAt: Date @dateformat updatedAt: Date @dateformat @@ -193,12 +193,12 @@ type ContentfulNumber implements ContentfulReference & ContentfulEntry & Node @d decimal: Float } -type ContentfulContentReference implements ContentfulReference & ContentfulEntry & Node @derivedTypes @dontInfer { +type ContentfulContentReference implements ContentfulReference & ContentfulEntry & Node @dontInfer { contentful_id: String! node_locale: String! title: String one: ContentfulContentReferenceContentfulTextUnion @link(by: "id", from: "one___NODE") - content_reference: [ContentfulContentReference] @link(by: "id", from: "content reference___NODE") @proxy(from: "content reference___NODE") + content_reference: [ContentfulContentReference] @link(by: "id", from: "content reference___NODE") @proxy(from: "content reference___NODE", fromNode: false) spaceId: String createdAt: Date @dateformat updatedAt: Date @dateformat @@ -208,13 +208,13 @@ type ContentfulContentReference implements ContentfulReference & ContentfulEntry union ContentfulContentReferenceContentfulTextUnion = ContentfulContentReference | ContentfulText -type ContentfulContentReferenceSys @derivedTypes { +type ContentfulContentReferenceSys { type: String revision: Int contentType: ContentfulContentReferenceSysContentType } -type ContentfulContentReferenceSysContentType @derivedTypes { +type ContentfulContentReferenceSysContentType { sys: ContentfulContentReferenceSysContentTypeSys } @@ -226,13 +226,13 @@ type ContentfulContentReferenceSysContentTypeSys { union ContentfulContentReferenceContentfulNumberContentfulTextUnion = ContentfulContentReference | ContentfulNumber | ContentfulText -type ContentfulNumberSys @derivedTypes { +type ContentfulNumberSys { type: String revision: Int contentType: ContentfulNumberSysContentType } -type ContentfulNumberSysContentType @derivedTypes { +type ContentfulNumberSysContentType { sys: ContentfulNumberSysContentTypeSys } @@ -242,7 +242,7 @@ type ContentfulNumberSysContentTypeSys { id: String } -type ContentfulText implements ContentfulReference & ContentfulEntry & Node @derivedTypes @dontInfer { +type ContentfulText implements ContentfulReference & ContentfulEntry & Node @dontInfer { contentful_id: String! node_locale: String! title: String @@ -253,11 +253,11 @@ type ContentfulText implements ContentfulReference & ContentfulEntry & Node @der sys: ContentfulTextSys longPlain: contentfulTextLongPlainTextNode @link(by: "id", from: "longPlain___NODE") short: String - content_reference: [ContentfulContentReference] @link(by: "id", from: "content reference___NODE") @proxy(from: "content reference___NODE") + content_reference: [ContentfulContentReference] @link(by: "id", from: "content reference___NODE") @proxy(from: "content reference___NODE", fromNode: false) shortList: [String] } -type contentfulTextLongMarkdownTextNode implements Node @derivedTypes @childOf(types: ["ContentfulText"]) @dontInfer { +type contentfulTextLongMarkdownTextNode implements Node @childOf(mimeTypes: [], types: ["ContentfulText"]) @dontInfer { longMarkdown: String sys: contentfulTextLongMarkdownTextNodeSys } @@ -266,13 +266,13 @@ type contentfulTextLongMarkdownTextNodeSys { type: String } -type ContentfulTextSys @derivedTypes { +type ContentfulTextSys { type: String revision: Int contentType: ContentfulTextSysContentType } -type ContentfulTextSysContentType @derivedTypes { +type ContentfulTextSysContentType { sys: ContentfulTextSysContentTypeSys } @@ -282,7 +282,7 @@ type ContentfulTextSysContentTypeSys { id: String } -type contentfulTextLongPlainTextNode implements Node @derivedTypes @childOf(types: ["ContentfulText"]) @dontInfer { +type contentfulTextLongPlainTextNode implements Node @childOf(mimeTypes: [], types: ["ContentfulText"]) @dontInfer { longPlain: String sys: contentfulTextLongPlainTextNodeSys } @@ -291,7 +291,7 @@ type contentfulTextLongPlainTextNodeSys { type: String } -type ContentfulMediaReference implements ContentfulReference & ContentfulEntry & Node @derivedTypes @dontInfer { +type ContentfulMediaReference implements ContentfulReference & ContentfulEntry & Node @dontInfer { contentful_id: String! node_locale: String! title: String @@ -303,13 +303,13 @@ type ContentfulMediaReference implements ContentfulReference & ContentfulEntry & one: ContentfulAsset @link(by: "id", from: "one___NODE") } -type ContentfulMediaReferenceSys @derivedTypes { +type ContentfulMediaReferenceSys { type: String revision: Int contentType: ContentfulMediaReferenceSysContentType } -type ContentfulMediaReferenceSysContentType @derivedTypes { +type ContentfulMediaReferenceSysContentType { sys: ContentfulMediaReferenceSysContentTypeSys } @@ -319,7 +319,7 @@ type ContentfulMediaReferenceSysContentTypeSys { id: String } -type ContentfulBoolean implements ContentfulReference & ContentfulEntry & Node @derivedTypes @dontInfer { +type ContentfulBoolean implements ContentfulReference & ContentfulEntry & Node @dontInfer { contentful_id: String! node_locale: String! title: String @@ -330,13 +330,13 @@ type ContentfulBoolean implements ContentfulReference & ContentfulEntry & Node @ boolean: Boolean } -type ContentfulBooleanSys @derivedTypes { +type ContentfulBooleanSys { type: String revision: Int contentType: ContentfulBooleanSysContentType } -type ContentfulBooleanSysContentType @derivedTypes { +type ContentfulBooleanSysContentType { sys: ContentfulBooleanSysContentTypeSys } @@ -346,7 +346,7 @@ type ContentfulBooleanSysContentTypeSys { id: String } -type ContentfulDate implements ContentfulReference & ContentfulEntry & Node @derivedTypes @dontInfer { +type ContentfulDate implements ContentfulReference & ContentfulEntry & Node @dontInfer { contentful_id: String! node_locale: String! title: String @@ -359,13 +359,13 @@ type ContentfulDate implements ContentfulReference & ContentfulEntry & Node @der date: Date @dateformat } -type ContentfulDateSys @derivedTypes { +type ContentfulDateSys { type: String revision: Int contentType: ContentfulDateSysContentType } -type ContentfulDateSysContentType @derivedTypes { +type ContentfulDateSysContentType { sys: ContentfulDateSysContentTypeSys } @@ -375,7 +375,7 @@ type ContentfulDateSysContentTypeSys { id: String } -type ContentfulLocation implements ContentfulReference & ContentfulEntry & Node @derivedTypes @dontInfer { +type ContentfulLocation implements ContentfulReference & ContentfulEntry & Node @dontInfer { contentful_id: String! node_locale: String! title: String @@ -391,13 +391,13 @@ type ContentfulLocationLocation { lon: Float } -type ContentfulLocationSys @derivedTypes { +type ContentfulLocationSys { type: String revision: Int contentType: ContentfulLocationSysContentType } -type ContentfulLocationSysContentType @derivedTypes { +type ContentfulLocationSysContentType { sys: ContentfulLocationSysContentTypeSys } @@ -407,7 +407,7 @@ type ContentfulLocationSysContentTypeSys { id: String } -type ContentfulJson implements ContentfulReference & ContentfulEntry & Node @derivedTypes @dontInfer { +type ContentfulJson implements ContentfulReference & ContentfulEntry & Node @dontInfer { contentful_id: String! node_locale: String! title: String @@ -418,7 +418,7 @@ type ContentfulJson implements ContentfulReference & ContentfulEntry & Node @der sys: ContentfulJsonSys } -type contentfulJsonJsonJsonNode implements Node @derivedTypes @childOf(types: ["ContentfulJson"]) @dontInfer { +type contentfulJsonJsonJsonNode implements Node @childOf(mimeTypes: [], types: ["ContentfulJson"]) @dontInfer { Actors: [contentfulJsonJsonJsonNodeActors] sys: contentfulJsonJsonJsonNodeSys name: String @@ -429,7 +429,7 @@ type contentfulJsonJsonJsonNode implements Node @derivedTypes @childOf(types: [" type contentfulJsonJsonJsonNodeActors { name: String age: Int - Born_At: String @proxy(from: "Born At") + Born_At: String @proxy(from: "Born At", fromNode: false) Birthdate: String photo: String wife: String @@ -443,13 +443,13 @@ type contentfulJsonJsonJsonNodeSys { type: String } -type ContentfulJsonSys @derivedTypes { +type ContentfulJsonSys { type: String revision: Int contentType: ContentfulJsonSysContentType } -type ContentfulJsonSysContentType @derivedTypes { +type ContentfulJsonSysContentType { sys: ContentfulJsonSysContentTypeSys } @@ -459,7 +459,7 @@ type ContentfulJsonSysContentTypeSys { id: String } -type ContentfulRichText implements ContentfulReference & ContentfulEntry & Node @derivedTypes @dontInfer { +type ContentfulRichText implements ContentfulReference & ContentfulEntry & Node @dontInfer { contentful_id: String! node_locale: String! title: String @@ -477,13 +477,13 @@ type ContentfulRichTextRichText { union ContentfulAssetContentfulContentReferenceContentfulLocationContentfulTextUnion = ContentfulAsset | ContentfulContentReference | ContentfulLocation | ContentfulText -type ContentfulRichTextSys @derivedTypes { +type ContentfulRichTextSys { type: String revision: Int contentType: ContentfulRichTextSysContentType } -type ContentfulRichTextSysContentType @derivedTypes { +type ContentfulRichTextSysContentType { sys: ContentfulRichTextSysContentTypeSys } @@ -493,7 +493,7 @@ type ContentfulRichTextSysContentTypeSys { id: String } -type ContentfulContentType implements Node @derivedTypes @dontInfer { +type ContentfulContentType implements Node @dontInfer { name: String displayField: String description: String From 9f4e751c7f872f91bb07f560f400fb36f63aa1a4 Mon Sep 17 00:00:00 2001 From: axe312ger Date: Thu, 20 May 2021 12:38:11 +0200 Subject: [PATCH 5/5] test(contentful): wait for images to render in rich text and update related snapshots --- e2e-tests/contentful/cypress/integration/rich-text.js | 8 ++++++++ e2e-tests/contentful/snapshots.js | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/e2e-tests/contentful/cypress/integration/rich-text.js b/e2e-tests/contentful/cypress/integration/rich-text.js index fe8087da7eaeb..fd23726411154 100644 --- a/e2e-tests/contentful/cypress/integration/rich-text.js +++ b/e2e-tests/contentful/cypress/integration/rich-text.js @@ -3,6 +3,10 @@ describe(`rich-text`, () => { cy.visit("/rich-text").waitForRouteChange() }) it(`rich-text: All Features`, () => { + cy.get(`[data-cy-id="rich-text-all-features"]`).scrollIntoView({ + duration: 500, + }) + cy.wait(1000) cy.get(`[data-cy-id="rich-text-all-features"]`).snapshot() }) it(`rich-text: Basic`, () => { @@ -12,6 +16,10 @@ describe(`rich-text`, () => { cy.get(`[data-cy-id="rich-text-embedded-entry"]`).snapshot() }) it(`rich-text: Embedded Asset`, () => { + cy.get(`[data-cy-id="rich-text-embedded-asset"]`).scrollIntoView({ + duration: 500, + }) + cy.wait(1000) cy.get(`[data-cy-id="rich-text-embedded-asset"]`).snapshot() }) it(`rich-text: Embedded Entry With Deep Reference Loop`, () => { diff --git a/e2e-tests/contentful/snapshots.js b/e2e-tests/contentful/snapshots.js index e5fef239f4e87..441f5c4956cce 100644 --- a/e2e-tests/contentful/snapshots.js +++ b/e2e-tests/contentful/snapshots.js @@ -1,4 +1,5 @@ module.exports = { + "__version": "6.9.1", "content-reference": { "content-reference-many-2nd-level-loop": { "1": "
\n

Content Reference: Many (2nd level loop)

\n

[ContentfulInteger]\n 42

\n

[ContentfulText]\n The quick brown fox jumps over the lazy dog.

\n

[ContentfulReference]\n Content Reference: One (Loop A -> B)\n : [\n Content Reference: One (Loop B -> A)\n ]

\n
" @@ -25,10 +26,9 @@ module.exports = { "1": "
\n

Content Reference: One (Self Reference)

\n

[ContentfulReference]\n Content Reference: One (Self Reference)\n : [\n Content Reference: One (Self Reference)\n ]

\n
" } }, - "__version": "6.8.0", "rich-text": { "rich-text: All Features": { - "1": "
\n

Rich Text: All Features

\n

The European languages

\n

are members of the same family. Their separate existence is a myth. For:

\n
    \n
  • \n

    science

    \n
  • \n
  • \n

    music

    \n
  • \n
  • \n

    sport

    \n
  • \n
  • \n

    etc

    \n
  • \n
\n

Europe uses the same vocabulary.

\n
\n
\"\"\n\n
\n

\n
\n

The languages only differ in:

\n
    \n
  1. \n

    their grammar

    \n
  2. \n
  3. \n

    their pronunciation

    \n
  4. \n
  5. \n

    their most common words

    \n
  6. \n
  7. \n

    [Inline-ContentfulText]\n Text: Short\n :\n The quick brown fox jumps over the lazy dog.

    \n
  8. \n
\n

Everyone realizes why a new common language would be desirable: one could\n refuse to pay expensive translators.

\n

{\n \"userId\": 1,\n \"id\": 1,\n \"title\": \"delectus aut autem\",\n \"completed\": false\n }

\n

To achieve this, it would be necessary to have uniform grammar,\n pronunciation and more common words.

\n

[ContentfulLocation] Lat:\n 52.51627\n , Long:\n 13.3777

\n
\n

If several languages coalesce, the grammar of the resulting language is\n more simple and regular than that of the individual languages.

\n
\n

The new common language will be more simple and regular than the existing\n European languages. It will be as simple as Occidental; in fact, it will be\n

\n
\n
" + "1": "
\n

Rich Text: All Features

\n

The European languages

\n

are members of the same family. Their separate existence is a myth. For:

\n
    \n
  • \n

    science

    \n
  • \n
  • \n

    music

    \n
  • \n
  • \n

    sport

    \n
  • \n
  • \n

    etc

    \n
  • \n
\n

Europe uses the same vocabulary.

\n
\n
\"\"\n\n \n \n \n
\n

\n
\n

The languages only differ in:

\n
    \n
  1. \n

    their grammar

    \n
  2. \n
  3. \n

    their pronunciation

    \n
  4. \n
  5. \n

    their most common words

    \n
  6. \n
  7. \n

    [Inline-ContentfulText]\n Text: Short\n :\n The quick brown fox jumps over the lazy dog.

    \n
  8. \n
\n

Everyone realizes why a new common language would be desirable: one could\n refuse to pay expensive translators.

\n

{\n \"userId\": 1,\n \"id\": 1,\n \"title\": \"delectus aut autem\",\n \"completed\": false\n }

\n

To achieve this, it would be necessary to have uniform grammar,\n pronunciation and more common words.

\n

[ContentfulLocation] Lat:\n 52.51627\n , Long:\n 13.3777

\n
\n

If several languages coalesce, the grammar of the resulting language is\n more simple and regular than that of the individual languages.

\n
\n

The new common language will be more simple and regular than the existing\n European languages. It will be as simple as Occidental; in fact, it will be\n

\n
\n
" }, "rich-text: Basic": { "1": "
\n

Rich Text: Basic

\n

The European languages

\n

are members of the same family. Their separate existence is a myth. For:

\n
    \n
  • \n

    science

    \n
  • \n
  • \n

    music

    \n
  • \n
  • \n

    sport

    \n
  • \n
  • \n

    etc

    \n
  • \n
\n

Europe uses the same vocabulary.

\n
\n

The languages only differ in:

\n
    \n
  1. \n

    their grammar

    \n
  2. \n
  3. \n

    their pronunciation

    \n
  4. \n
  5. \n

    their most common words

    \n
  6. \n
\n

Everyone realizes why a new common language would be desirable: one could\n refuse to pay expensive translators.

\n

{\n \"userId\": 1,\n \"id\": 1,\n \"title\": \"delectus aut autem\",\n \"completed\": false\n }

\n

To achieve this, it would be necessary to have uniform grammar,\n pronunciation and more common words.

\n
\n

If several languages coalesce, the grammar of the resulting language is\n more simple and regular than that of the individual languages.

\n
\n

The new common language will be more simple and regular than the existing\n European languages. It will be as simple as Occidental; in fact, it will be\n

\n
\n
" @@ -37,7 +37,7 @@ module.exports = { "1": "
\n

Rich Text: Embedded Entry

\n

Embedded Entry

\n

[ContentfulText]\n The quick brown fox jumps over the lazy dog.

\n

\n

\n
\n
" }, "rich-text: Embedded Asset": { - "1": "
\n

Rich Text: Embedded asset

\n

Embedded Asset

\n
\n
\n
\n

\n

\n

\n
\n
" + "1": "
\n

Rich Text: Embedded asset

\n

Embedded Asset

\n
\n
\n \n \n \n
\n

\n

\n

\n
\n
" }, "rich-text: Embedded Entry With Deep Reference Loop": { "1": "
\n

Rich Text: Embedded entry with deep reference loop

\n

Embedded entry with deep reference loop

\n

[ContentfulReference]\n Content Reference: Many (2nd level loop)\n : [\n Number: Integer, Text: Short, Content Reference: One (Loop A ->\n B)\n ]

\n

\n

\n
\n
"