Skip to content

Commit

Permalink
[from now] 2022/02/25 22:54:02
Browse files Browse the repository at this point in the history
diff --git a/.github/workflows/cypress-test.yaml b/.github/workflows/cypress-test.yaml
index c80ac37..8626403 100644
--- a/.github/workflows/cypress-test.yaml
+++ b/.github/workflows/cypress-test.yaml
@@ -6,10 +6,6 @@ on:
 jobs:
   cypress-run:
     runs-on: ubuntu-latest
-    container:
-      image: cypress/browsers:node16.5.0-chrome97-ff96
-      # @see cypress-io/github-action#446 (comment)
-      options: --user 1001
     steps:
       - uses: actions/checkout@v2
       - name: Cache pnpm modules
@@ -30,18 +26,20 @@ jobs:
           cache: "pnpm"
       - name: Build extension
         run: pnpm build
-      # tests multiple browser
       - name: Cypress run on Chrome
         uses: cypress-io/github-action@v2
         with:
           install: false
           start: pnpm run serve
           wait-on: 'http://localhost:3000'
-          browser: chrome
-      - name: Cypress run on Firefox
-        uses: cypress-io/github-action@v2
+      - uses: actions/upload-artifact@v2
+        if: failure()
         with:
-          install: false
-          start: pnpm run serve
-          wait-on: 'http://localhost:3000'
-          browser: firefox
\ No newline at end of file
+          name: cypress-screenshots
+          path: cypress/screenshots
+      # Test run video was always captured, so this action uses "always()" condition
+      - uses: actions/upload-artifact@v2
+        if: always()
+        with:
+          name: cypress-videos
+          path: cypress/videos
\ No newline at end of file
diff --git a/cypress/integration/e2e.ts b/cypress/integration/e2e.ts
index bceba02..e396346 100644
--- a/cypress/integration/e2e.ts
+++ b/cypress/integration/e2e.ts
@@ -113,7 +113,7 @@ describe("App", () => {
     cy.window().its("close").should("be.called");
   });

-  it.skip("TODO: on Enter key", () => {
+  it.only("TODO: on Enter key", () => {
     cy.get("[data-cy=search-input]").type("history-item");
     cy.get("[data-cy=search-result-0]").should("have.class", "selected-item");
     cy.get("[data-cy=search-input]").type("{enter}");
diff --git a/cypress/support/support.ts b/cypress/support/support.ts
index 5af019e..f518131 100644
--- a/cypress/support/support.ts
+++ b/cypress/support/support.ts
@@ -21,8 +21,9 @@ export const setupExtensionEnvironment = ({
       addListener: cy.stub(),
     } as any,
     onConnect: {
-      addListener: cy.stub(),
+      addListener: cy.stub().as("onConnect"),
     } as any,
+    connect: cy.stub().as("connect").returns(cy.stub())
   };
   (win.chrome.history as Partial<typeof chrome.history>) = {
     search: ((_: any, callback: (data: any[]) => void) => {
  • Loading branch information
kawamataryo committed Feb 25, 2022
1 parent 7162b8f commit f93aaef
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
22 changes: 10 additions & 12 deletions .github/workflows/cypress-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ on:
jobs:
cypress-run:
runs-on: ubuntu-latest
container:
image: cypress/browsers:node16.5.0-chrome97-ff96
# @see https://github.com/cypress-io/github-action/issues/446#issuecomment-987015822
options: --user 1001
steps:
- uses: actions/checkout@v2
- name: Cache pnpm modules
Expand All @@ -30,18 +26,20 @@ jobs:
cache: "pnpm"
- name: Build extension
run: pnpm build
# tests multiple browser
- name: Cypress run on Chrome
uses: cypress-io/github-action@v2
with:
install: false
start: pnpm run serve
wait-on: 'http://localhost:3000'
browser: chrome
- name: Cypress run on Firefox
uses: cypress-io/github-action@v2
- uses: actions/upload-artifact@v2
if: failure()
with:
install: false
start: pnpm run serve
wait-on: 'http://localhost:3000'
browser: firefox
name: cypress-screenshots
path: cypress/screenshots
# Test run video was always captured, so this action uses "always()" condition
- uses: actions/upload-artifact@v2
if: always()
with:
name: cypress-videos
path: cypress/videos
2 changes: 1 addition & 1 deletion cypress/integration/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ describe("App", () => {
cy.window().its("close").should("be.called");
});

it.skip("TODO: on Enter key", () => {
it.only("TODO: on Enter key", () => {
cy.get("[data-cy=search-input]").type("history-item");
cy.get("[data-cy=search-result-0]").should("have.class", "selected-item");
cy.get("[data-cy=search-input]").type("{enter}");
Expand Down
3 changes: 2 additions & 1 deletion cypress/support/support.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ export const setupExtensionEnvironment = ({
addListener: cy.stub(),
} as any,
onConnect: {
addListener: cy.stub(),
addListener: cy.stub().as("onConnect"),
} as any,
connect: cy.stub().as("connect").returns(cy.stub()),
};
(win.chrome.history as Partial<typeof chrome.history>) = {
search: ((_: any, callback: (data: any[]) => void) => {
Expand Down

0 comments on commit f93aaef

Please sign in to comment.