Skip to content

Commit

Permalink
- add the 2nd test (previously only 1 test would pass in the GitHub w…
Browse files Browse the repository at this point in the history
…orkflow)
  • Loading branch information
jasonbahl committed Feb 26, 2024
1 parent e15f259 commit 9eb0dfc
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions tests/e2e/specs/drawer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
typeQuery,
typeVariables,
clearCodeMirror
} from '../utils.js';
} from '../utils.js';

const { test, expect } = require( '@wordpress/e2e-test-utils-playwright' );

Expand All @@ -28,17 +28,17 @@ test('should open and close successfully', async ({ page }) => {
await expect(page.locator(selectors.graphiqlContainer)).not.toBeVisible();
});

// test('should execute a GraphQL query successfully', async ({ page }) => {
// await page.click(selectors.editorDrawerButton);
// await expect(page.locator(selectors.graphiqlContainer)).toBeVisible();
// // Type and execute a GraphQL query
// const query = '{posts{nodes{databaseId}}}';
// await typeQuery(page, query);
// await page.click(selectors.executeQueryButton);
// await page.waitForSelector('.graphiql-spinner', { state: 'hidden' }); // Wait for query execution
// // Check for expected response
// const expectedResponseText = `"data": {"posts": {"nodes": [{"databaseId": 1}]}}`;
// await expect(page.locator(selectors.graphiqlResponse)).toContainText(expectedResponseText);
// });
test('should execute a GraphQL query successfully', async ({ page }) => {
await page.click(selectors.editorDrawerButton);
await expect(page.locator(selectors.graphiqlContainer)).toBeVisible();

// Type and execute a GraphQL query
const query = '{posts{nodes{databaseId}}}';
await typeQuery(page, query);
await page.click(selectors.executeQueryButton);
await page.waitForSelector('.graphiql-spinner', { state: 'hidden' }); // Wait for query execution

// Check for expected response
const expectedResponseText = `"data": {"posts": {"nodes": [{"databaseId": 1}]}}`;
await expect(page.locator(selectors.graphiqlResponse)).toContainText(expectedResponseText);

Check failure on line 43 in tests/e2e/specs/drawer.spec.js

View workflow job for this annotation

GitHub Actions / E2E tests on Node 18

[chromium] › drawer.spec.js:31:1 › should execute a GraphQL query successfully

1) [chromium] › drawer.spec.js:31:1 › should execute a GraphQL query successfully ──────────────── Error: Timed out 5000ms waiting for expect(locator).toContainText(expected) Locator: locator('.graphiql-response') Expected string: "\"data\": {\"posts\": {\"nodes\": [{\"databaseId\": 1}]}}" Received string: "​x {  \"data\": {    \"posts\": {      \"nodes\": [        {          \"databaseId\": 1        }      ]    }  },  \"extensions\": {    \"debug\": [      {        \"type\": \"DEBUG_LOGS_INACTIVE\",        \"message\": \"GraphQL Debug logging is not active. To see debug logs, GRAPHQL_DEBUG must be enabled.\"      }    ]  }}" Call log: - expect.toContainText with timeout 5000ms - waiting for locator('.graphiql-response') - locator resolved to <div class="graphiql-response">…</div> - unexpected value "​x {  "data": {    "posts": {      "nodes": [        {          "databaseId": 1        }      ]    }  },  "extensions": {    "debug": [      {        "type": "DEBUG_LOGS_INACTIVE",        "message": "GraphQL Debug logging is not active. To see debug logs, GRAPHQL_DEBUG must be enabled."      }    ]  }}" - locator resolved to <div class="graphiql-response">…</div> - unexpected value "​x {  "data": {    "posts": {      "nodes": [        {          "databaseId": 1        }      ]    }  },  "extensions": {    "debug": [      {        "type": "DEBUG_LOGS_INACTIVE",        "message": "GraphQL Debug logging is not active. To see debug logs, GRAPHQL_DEBUG must be enabled."      }    ]  }}" - locator resolved to <div class="graphiql-response">…</div> - unexpected value "​x {  "data": {    "posts": {      "nodes": [        {          "databaseId": 1        }      ]    }  },  "extensions": {    "debug": [      {        "type": "DEBUG_LOGS_INACTIVE",        "message": "GraphQL Debug logging is not active. To see debug logs, GRAPHQL_DEBUG must be enabled."      }    ]  }}" - locator resolved to <div class="graphiql-response">…</div> - unexpected value "​x {  "data": {    "posts": {      "nodes": [        {          "databaseId": 1        }      ]    }  },  "extensions": {    "debug": [      {        "type": "DEBUG_LOGS_INACTIVE",        "message": "GraphQL Debug logging is not active. To see debug logs, GRAPHQL_DEBUG must be enabled."      }    ]  }}" - locator resolved to <div class="graphiql-response">…</div> - unexpected value "​x {  "data": {    "posts": {      "nodes": [        {          "databaseId": 1        }      ]    }  },  "extensions": {    "debug": [      {        "type": "DEBUG_LOGS_INACTIVE",        "message": "GraphQL Debug logging is not active. To see debug logs, GRAPHQL_DEBUG must be enabled."      }    ]  }}" - locator resolved to <div class="graphiql-response">…</div> - unexpected value "​x {  "data": {    "posts": {      "nodes": [        {          "databaseId": 1        }      ]    }  },  "extensions": {    "debug": [      {        "type": "DEBUG_LOGS_INACTIVE",        "message": "GraphQL Debug logging is not active. To see debug logs, GRAPHQL_DEBUG must be enabled."      }    ]  }}" - locator resolved to <div class="graphiql-response">…</div> - unexpected value "​x {  "data": {    "posts": {      "nodes": [        {          "databaseId": 1        }      ]    }  },  "extensions": {    "debug": [      {        "type": "DEBUG_LOGS_INACTIVE",        "message": "GraphQL Debug logging is not active. To see debug logs, GRAPHQL_DEBUG must be enabled."      }    ]  }}" - locator resolved to <div class="graphiql-response">…</div> - unexpected value "​x {  "data": {    "posts": {      "nodes": [        {          "databaseId": 1        }      ]    }  },  "extensions": {    "debug": [      {        "type": "DEBUG_LOGS_INACTIVE",        "message": "GraphQL Debug logging is not active. To see debug logs, GRAPHQL_DEBUG must be enabled."      }    ]  }}" - locator resolved to <div class="graphiql-response">…</div> - unexpected value "​x {  "data": {  

Check failure on line 43 in tests/e2e/specs/drawer.spec.js

View workflow job for this annotation

GitHub Actions / E2E tests on Node 18

[chromium] › drawer.spec.js:31:1 › should execute a GraphQL query successfully

1) [chromium] › drawer.spec.js:31:1 › should execute a GraphQL query successfully ──────────────── Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: Timed out 5000ms waiting for expect(locator).toContainText(expected) Locator: locator('.graphiql-response') Expected string: "\"data\": {\"posts\": {\"nodes\": [{\"databaseId\": 1}]}}" Received string: "​x {  \"data\": {    \"posts\": {      \"nodes\": [        {          \"databaseId\": 1        }      ]    }  },  \"extensions\": {    \"debug\": [      {        \"type\": \"DEBUG_LOGS_INACTIVE\",        \"message\": \"GraphQL Debug logging is not active. To see debug logs, GRAPHQL_DEBUG must be enabled.\"      }    ]  }}" Call log: - expect.toContainText with timeout 5000ms - waiting for locator('.graphiql-response') - locator resolved to <div class="graphiql-response">…</div> - unexpected value "​x {  "data": {    "posts": {      "nodes": [        {          "databaseId": 1        }      ]    }  },  "extensions": {    "debug": [      {        "type": "DEBUG_LOGS_INACTIVE",        "message": "GraphQL Debug logging is not active. To see debug logs, GRAPHQL_DEBUG must be enabled."      }    ]  }}" - locator resolved to <div class="graphiql-response">…</div> - unexpected value "​x {  "data": {    "posts": {      "nodes": [        {          "databaseId": 1        }      ]    }  },  "extensions": {    "debug": [      {        "type": "DEBUG_LOGS_INACTIVE",        "message": "GraphQL Debug logging is not active. To see debug logs, GRAPHQL_DEBUG must be enabled."      }    ]  }}" - locator resolved to <div class="graphiql-response">…</div> - unexpected value "​x {  "data": {    "posts": {      "nodes": [        {          "databaseId": 1        }      ]    }  },  "extensions": {    "debug": [      {        "type": "DEBUG_LOGS_INACTIVE",        "message": "GraphQL Debug logging is not active. To see debug logs, GRAPHQL_DEBUG must be enabled."      }    ]  }}" - locator resolved to <div class="graphiql-response">…</div> - unexpected value "​x {  "data": {    "posts": {      "nodes": [        {          "databaseId": 1        }      ]    }  },  "extensions": {    "debug": [      {        "type": "DEBUG_LOGS_INACTIVE",        "message": "GraphQL Debug logging is not active. To see debug logs, GRAPHQL_DEBUG must be enabled."      }    ]  }}" - locator resolved to <div class="graphiql-response">…</div> - unexpected value "​x {  "data": {    "posts": {      "nodes": [        {          "databaseId": 1        }      ]    }  },  "extensions": {    "debug": [      {        "type": "DEBUG_LOGS_INACTIVE",        "message": "GraphQL Debug logging is not active. To see debug logs, GRAPHQL_DEBUG must be enabled."      }    ]  }}" - locator resolved to <div class="graphiql-response">…</div> - unexpected value "​x {  "data": {    "posts": {      "nodes": [        {          "databaseId": 1        }      ]    }  },  "extensions": {    "debug": [      {        "type": "DEBUG_LOGS_INACTIVE",        "message": "GraphQL Debug logging is not active. To see debug logs, GRAPHQL_DEBUG must be enabled."      }    ]  }}" - locator resolved to <div class="graphiql-response">…</div> - unexpected value "​x {  "data": {    "posts": {      "nodes": [        {          "databaseId": 1        }      ]    }  },  "extensions": {    "debug": [      {        "type": "DEBUG_LOGS_INACTIVE",        "message": "GraphQL Debug logging is not active. To see debug logs, GRAPHQL_DEBUG must be enabled."      }    ]  }}" - locator resolved to <div class="graphiql-response">…</div> - unexpected value "​x {  "data": {    "posts": {      "nodes": [        {          "databaseId": 1        }      ]    }  },  "extensions": {    "debug": [      {        "type": "DEBUG_LOGS_INACTIVE",        "message": "GraphQL Debug logging is not active. To see debug logs, GRAPHQL_DEBUG must be enabled."      }    ]  }}" - lo

Check failure on line 43 in tests/e2e/specs/drawer.spec.js

View workflow job for this annotation

GitHub Actions / E2E tests on Node 18

[chromium] › drawer.spec.js:31:1 › should execute a GraphQL query successfully

1) [chromium] › drawer.spec.js:31:1 › should execute a GraphQL query successfully ──────────────── Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: Timed out 5000ms waiting for expect(locator).toContainText(expected) Locator: locator('.graphiql-response') Expected string: "\"data\": {\"posts\": {\"nodes\": [{\"databaseId\": 1}]}}" Received string: "​x {  \"data\": {    \"posts\": {      \"nodes\": [        {          \"databaseId\": 1        }      ]    }  },  \"extensions\": {    \"debug\": [      {        \"type\": \"DEBUG_LOGS_INACTIVE\",        \"message\": \"GraphQL Debug logging is not active. To see debug logs, GRAPHQL_DEBUG must be enabled.\"      }    ]  }}" Call log: - expect.toContainText with timeout 5000ms - waiting for locator('.graphiql-response') - locator resolved to <div class="graphiql-response">…</div> - unexpected value "​x {  "data": {    "posts": {      "nodes": [        {          "databaseId": 1        }      ]    }  },  "extensions": {    "debug": [      {        "type": "DEBUG_LOGS_INACTIVE",        "message": "GraphQL Debug logging is not active. To see debug logs, GRAPHQL_DEBUG must be enabled."      }    ]  }}" - locator resolved to <div class="graphiql-response">…</div> - unexpected value "​x {  "data": {    "posts": {      "nodes": [        {          "databaseId": 1        }      ]    }  },  "extensions": {    "debug": [      {        "type": "DEBUG_LOGS_INACTIVE",        "message": "GraphQL Debug logging is not active. To see debug logs, GRAPHQL_DEBUG must be enabled."      }    ]  }}" - locator resolved to <div class="graphiql-response">…</div> - unexpected value "​x {  "data": {    "posts": {      "nodes": [        {          "databaseId": 1        }      ]    }  },  "extensions": {    "debug": [      {        "type": "DEBUG_LOGS_INACTIVE",        "message": "GraphQL Debug logging is not active. To see debug logs, GRAPHQL_DEBUG must be enabled."      }    ]  }}" - locator resolved to <div class="graphiql-response">…</div> - unexpected value "​x {  "data": {    "posts": {      "nodes": [        {          "databaseId": 1        }      ]    }  },  "extensions": {    "debug": [      {        "type": "DEBUG_LOGS_INACTIVE",        "message": "GraphQL Debug logging is not active. To see debug logs, GRAPHQL_DEBUG must be enabled."      }    ]  }}" - locator resolved to <div class="graphiql-response">…</div> - unexpected value "​x {  "data": {    "posts": {      "nodes": [        {          "databaseId": 1        }      ]    }  },  "extensions": {    "debug": [      {        "type": "DEBUG_LOGS_INACTIVE",        "message": "GraphQL Debug logging is not active. To see debug logs, GRAPHQL_DEBUG must be enabled."      }    ]  }}" - locator resolved to <div class="graphiql-response">…</div> - unexpected value "​x {  "data": {    "posts": {      "nodes": [        {          "databaseId": 1        }      ]    }  },  "extensions": {    "debug": [      {        "type": "DEBUG_LOGS_INACTIVE",        "message": "GraphQL Debug logging is not active. To see debug logs, GRAPHQL_DEBUG must be enabled."      }    ]  }}" - locator resolved to <div class="graphiql-response">…</div> - unexpected value "​x {  "data": {    "posts": {      "nodes": [        {          "databaseId": 1        }      ]    }  },  "extensions": {    "debug": [      {        "type": "DEBUG_LOGS_INACTIVE",        "message": "GraphQL Debug logging is not active. To see debug logs, GRAPHQL_DEBUG must be enabled."      }    ]  }}" - locator resolved to <div class="graphiql-response">…</div> - unexpected value "​x {  "data": {    "posts": {      "nodes": [        {          "databaseId": 1        }      ]    }  },  "extensions": {    "debug": [      {        "type": "DEBUG_LOGS_INACTIVE",        "message": "GraphQL Debug logging is not active. To see debug logs, GRAPHQL_DEBUG must be enabled."      }    ]  }}" - lo
});

0 comments on commit 9eb0dfc

Please sign in to comment.