From 2615ac068875a1d73c4a95c3ec00ff1c72ef427c Mon Sep 17 00:00:00 2001 From: pcheremu Date: Wed, 6 Dec 2023 13:47:20 +0300 Subject: [PATCH 01/16] test: update tests for sepolia --- packages/app/cucumber.mjs | 2 +- .../tests/e2e/features/artifacts/artifactsSet1.feature | 1 + .../e2e/features/redirection/redirectionSet3.feature | 9 +++++---- packages/app/tests/e2e/src/data/data.ts | 1 + 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/app/cucumber.mjs b/packages/app/cucumber.mjs index 92b66724c3..a9a2bc4cbd 100644 --- a/packages/app/cucumber.mjs +++ b/packages/app/cucumber.mjs @@ -16,7 +16,7 @@ export default { "summary", "progress-bar", "@cucumber/pretty-formatter", - "./tests/e2e/src/support/reporters/allure-reporter.js", + // "./tests/e2e/src/support/reporters/allure-reporter.js", ], formatOptions: { snippetInterface: "async-await" }, worldParameters: getWorldParams(), diff --git a/packages/app/tests/e2e/features/artifacts/artifactsSet1.feature b/packages/app/tests/e2e/features/artifacts/artifactsSet1.feature index c001055d46..4b1cb560f2 100644 --- a/packages/app/tests/e2e/features/artifacts/artifactsSet1.feature +++ b/packages/app/tests/e2e/features/artifacts/artifactsSet1.feature @@ -94,6 +94,7 @@ Feature: Main Page Examples: | Value | Dropdown | | zkSync Era Goerli Testnet | network | + | zkSync Era Sepolia Testnet | network | Scenario: Network stats is displayed Then Element with "text" "Network Stats" should be "visible" diff --git a/packages/app/tests/e2e/features/redirection/redirectionSet3.feature b/packages/app/tests/e2e/features/redirection/redirectionSet3.feature index 3d6c238a45..1491fc56b8 100644 --- a/packages/app/tests/e2e/features/redirection/redirectionSet3.feature +++ b/packages/app/tests/e2e/features/redirection/redirectionSet3.feature @@ -65,7 +65,7 @@ Feature: Redirection | /address/0x000000000000000000000000000000000000800A | zkSync Era Goerli Testnet | /address/0x000000000000000000000000000000000000800A/?network=goerli | | /address/0x000000000000000000000000000000000000800A | Goerli (Stage2) | /address/0x000000000000000000000000000000000000800A/?network=goerli-beta | | /address/0x000000000000000000000000000000000000800A | zkSync Era Mainnet | /address/0x000000000000000000000000000000000000800A/?network=mainnet | - | /address/0x000000000000000000000000000000000000800A | zkSync Era Sepolia Testnet | /address/0x000000000000000000000000000000000000800A/?network=sepolia | + | /address/0x000000000000000000000000000000000000800A | zkSync Era Sepolia Testnet | /address/0x000000000000000000000000000000000000800A/?network=sepolia | @id561:I @id562:I @id563:I @productionEnv Scenario Outline: Verify redirection to "" network @@ -74,6 +74,7 @@ Feature: Redirection Then Current page have "" address Examples: - | Initial page | Network | url | - | /address/0x000000000000000000000000000000000000800A | zkSync Era Mainnet | /address/0x000000000000000000000000000000000000800A/?network=mainnet | - | /address/0x000000000000000000000000000000000000800A | zkSync Era Goerli Testnet | /address/0x000000000000000000000000000000000000800A/?network=goerli | + | Initial page | Network | url | + | /address/0x000000000000000000000000000000000000800A | zkSync Era Mainnet | /address/0x000000000000000000000000000000000000800A | + | /address/0x000000000000000000000000000000000000800A | zkSync Era Goerli Testnet | /address/0x000000000000000000000000000000000000800A | + | /address/0x000000000000000000000000000000000000800A | zkSync Era Sepolia Testnet | /address/0x000000000000000000000000000000000000800A | diff --git a/packages/app/tests/e2e/src/data/data.ts b/packages/app/tests/e2e/src/data/data.ts index 1fe9fa5a43..64b8362960 100644 --- a/packages/app/tests/e2e/src/data/data.ts +++ b/packages/app/tests/e2e/src/data/data.ts @@ -2,4 +2,5 @@ export enum NetworkSwitcher { zkSyncEraGoerli = "/?network=goerli", goerliStage2 = "/?network=goerli-beta", zkSyncEraMainnet = "/?network=mainnet", + zkSyncEraSepolia = "/?network=sepolia", } From bdd9bd610f4bfa0560956b4f7f09a01f9d20310e Mon Sep 17 00:00:00 2001 From: pcheremu Date: Wed, 6 Dec 2023 13:52:46 +0300 Subject: [PATCH 02/16] test: refactoring --- packages/app/cucumber.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/app/cucumber.mjs b/packages/app/cucumber.mjs index a9a2bc4cbd..6b3342d9e8 100644 --- a/packages/app/cucumber.mjs +++ b/packages/app/cucumber.mjs @@ -16,7 +16,7 @@ export default { "summary", "progress-bar", "@cucumber/pretty-formatter", - // "./tests/e2e/src/support/reporters/allure-reporter.js", + // "./tests/e2e/src/support/reporters/allure-reporter.js", ], formatOptions: { snippetInterface: "async-await" }, worldParameters: getWorldParams(), From e6b6a5cb2acb04133531dad931bedd23478ac924 Mon Sep 17 00:00:00 2001 From: pcheremu Date: Wed, 6 Dec 2023 14:13:57 +0300 Subject: [PATCH 03/16] test: refactoring --- .../e2e/features/redirection/redirectionSet3.feature | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/app/tests/e2e/features/redirection/redirectionSet3.feature b/packages/app/tests/e2e/features/redirection/redirectionSet3.feature index 1491fc56b8..970f0c8325 100644 --- a/packages/app/tests/e2e/features/redirection/redirectionSet3.feature +++ b/packages/app/tests/e2e/features/redirection/redirectionSet3.feature @@ -74,7 +74,7 @@ Feature: Redirection Then Current page have "" address Examples: - | Initial page | Network | url | - | /address/0x000000000000000000000000000000000000800A | zkSync Era Mainnet | /address/0x000000000000000000000000000000000000800A | - | /address/0x000000000000000000000000000000000000800A | zkSync Era Goerli Testnet | /address/0x000000000000000000000000000000000000800A | - | /address/0x000000000000000000000000000000000000800A | zkSync Era Sepolia Testnet | /address/0x000000000000000000000000000000000000800A | + | Initial page | Network | url | + | /address/0x000000000000000000000000000000000000800A | zkSync Era Goerli Testnet | /address/0x000000000000000000000000000000000000800A/?network=goerli | + | /address/0x000000000000000000000000000000000000800A | zkSync Era Sepolia Testnet | /address/0x000000000000000000000000000000000000800A/?network=sepolia | + | /address/0x000000000000000000000000000000000000800A | zkSync Era Mainnet | /address/0x000000000000000000000000000000000000800A/?network=mainnet | From 221d31f102d130cdd0a66abfba983f96cebd2036 Mon Sep 17 00:00:00 2001 From: pcheremu Date: Wed, 6 Dec 2023 14:34:26 +0300 Subject: [PATCH 04/16] test: refactoring --- packages/app/cucumber.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/app/cucumber.mjs b/packages/app/cucumber.mjs index 6b3342d9e8..92b66724c3 100644 --- a/packages/app/cucumber.mjs +++ b/packages/app/cucumber.mjs @@ -16,7 +16,7 @@ export default { "summary", "progress-bar", "@cucumber/pretty-formatter", - // "./tests/e2e/src/support/reporters/allure-reporter.js", + "./tests/e2e/src/support/reporters/allure-reporter.js", ], formatOptions: { snippetInterface: "async-await" }, worldParameters: getWorldParams(), From fd74c3863f59d5f2bfb2d8be6ed0718b23f46bbd Mon Sep 17 00:00:00 2001 From: pcheremu Date: Wed, 6 Dec 2023 14:53:56 +0300 Subject: [PATCH 05/16] test: switch default test network to sepolia --- packages/app/cucumber.mjs | 2 +- .../app/src/composables/useRuntimeConfig.ts | 20 +++++++++---------- packages/app/src/configs/index.ts | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/app/cucumber.mjs b/packages/app/cucumber.mjs index 92b66724c3..6b3342d9e8 100644 --- a/packages/app/cucumber.mjs +++ b/packages/app/cucumber.mjs @@ -16,7 +16,7 @@ export default { "summary", "progress-bar", "@cucumber/pretty-formatter", - "./tests/e2e/src/support/reporters/allure-reporter.js", + // "./tests/e2e/src/support/reporters/allure-reporter.js", ], formatOptions: { snippetInterface: "async-await" }, worldParameters: getWorldParams(), diff --git a/packages/app/src/composables/useRuntimeConfig.ts b/packages/app/src/composables/useRuntimeConfig.ts index b0a053ee8e..70cb7a6557 100644 --- a/packages/app/src/composables/useRuntimeConfig.ts +++ b/packages/app/src/composables/useRuntimeConfig.ts @@ -1,19 +1,19 @@ import type { NetworkConfig, RuntimeConfig } from "@/configs"; export const DEFAULT_NETWORK: NetworkConfig = { - apiUrl: "https://block-explorer-api.testnets.zksync.dev", - verificationApiUrl: "https://zksync2-testnet-explorer.zksync.dev", - bridgeUrl: "https://goerli.bridge.zksync.io", - hostnames: ["https://goerli.explorer.zksync.io"], + apiUrl: "https://block-explorer-api.sepolia.zksync.dev", + verificationApiUrl: "https://explorer.sepolia.era.zksync.dev", + bridgeUrl: "https://staging.goerli.bridge.zksync.dev", + hostnames: ["https://sepolia.explorer.zksync.io"], icon: "/images/icons/zksync-arrows.svg", - l1ExplorerUrl: "https://goerli.etherscan.io", - l2ChainId: 280, - l2NetworkName: "zkSync Era Goerli Testnet", - l2WalletUrl: "https://goerli.portal.zksync.io/", + l1ExplorerUrl: "https://sepolia.etherscan.io", + l2ChainId: 300, + l2NetworkName: "zkSync Era Sepolia Testnet", + l2WalletUrl: "https://staging-portal.zksync.dev/?network=era-boojnet", maintenance: false, - name: "goerli", + name: "sepolia", published: true, - rpcUrl: "https://testnet.era.zksync.dev", + rpcUrl: "https://sepolia.era.zksync.dev" }; export default (): RuntimeConfig => { diff --git a/packages/app/src/configs/index.ts b/packages/app/src/configs/index.ts index 5660e1ccdd..5fa482bbae 100644 --- a/packages/app/src/configs/index.ts +++ b/packages/app/src/configs/index.ts @@ -7,7 +7,7 @@ export type NetworkConfig = { bridgeUrl?: string; l2NetworkName: string; l2WalletUrl: string; - l2ChainId: 270 | 280 | 324; + l2ChainId: 270 | 280 | 324 | 300; l1ExplorerUrl?: string; maintenance: boolean; published: boolean; From 6e4b2b8c5ceb8b12afafd91244f294a30cc3578b Mon Sep 17 00:00:00 2001 From: pcheremu Date: Wed, 6 Dec 2023 15:02:03 +0300 Subject: [PATCH 06/16] test: refactoring --- packages/app/src/composables/useRuntimeConfig.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/app/src/composables/useRuntimeConfig.ts b/packages/app/src/composables/useRuntimeConfig.ts index 70cb7a6557..811b5fca14 100644 --- a/packages/app/src/composables/useRuntimeConfig.ts +++ b/packages/app/src/composables/useRuntimeConfig.ts @@ -13,7 +13,7 @@ export const DEFAULT_NETWORK: NetworkConfig = { maintenance: false, name: "sepolia", published: true, - rpcUrl: "https://sepolia.era.zksync.dev" + rpcUrl: "https://sepolia.era.zksync.dev", }; export default (): RuntimeConfig => { From 4d9cebab4d446787e05e6e16968cf7c1eb793f40 Mon Sep 17 00:00:00 2001 From: pcheremu Date: Wed, 6 Dec 2023 15:33:00 +0300 Subject: [PATCH 07/16] test: refactoring --- packages/app/cucumber.mjs | 2 +- .../app/src/composables/useRuntimeConfig.ts | 20 +++++++++---------- packages/app/src/configs/index.ts | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/app/cucumber.mjs b/packages/app/cucumber.mjs index 6b3342d9e8..92b66724c3 100644 --- a/packages/app/cucumber.mjs +++ b/packages/app/cucumber.mjs @@ -16,7 +16,7 @@ export default { "summary", "progress-bar", "@cucumber/pretty-formatter", - // "./tests/e2e/src/support/reporters/allure-reporter.js", + "./tests/e2e/src/support/reporters/allure-reporter.js", ], formatOptions: { snippetInterface: "async-await" }, worldParameters: getWorldParams(), diff --git a/packages/app/src/composables/useRuntimeConfig.ts b/packages/app/src/composables/useRuntimeConfig.ts index 811b5fca14..b0a053ee8e 100644 --- a/packages/app/src/composables/useRuntimeConfig.ts +++ b/packages/app/src/composables/useRuntimeConfig.ts @@ -1,19 +1,19 @@ import type { NetworkConfig, RuntimeConfig } from "@/configs"; export const DEFAULT_NETWORK: NetworkConfig = { - apiUrl: "https://block-explorer-api.sepolia.zksync.dev", - verificationApiUrl: "https://explorer.sepolia.era.zksync.dev", - bridgeUrl: "https://staging.goerli.bridge.zksync.dev", - hostnames: ["https://sepolia.explorer.zksync.io"], + apiUrl: "https://block-explorer-api.testnets.zksync.dev", + verificationApiUrl: "https://zksync2-testnet-explorer.zksync.dev", + bridgeUrl: "https://goerli.bridge.zksync.io", + hostnames: ["https://goerli.explorer.zksync.io"], icon: "/images/icons/zksync-arrows.svg", - l1ExplorerUrl: "https://sepolia.etherscan.io", - l2ChainId: 300, - l2NetworkName: "zkSync Era Sepolia Testnet", - l2WalletUrl: "https://staging-portal.zksync.dev/?network=era-boojnet", + l1ExplorerUrl: "https://goerli.etherscan.io", + l2ChainId: 280, + l2NetworkName: "zkSync Era Goerli Testnet", + l2WalletUrl: "https://goerli.portal.zksync.io/", maintenance: false, - name: "sepolia", + name: "goerli", published: true, - rpcUrl: "https://sepolia.era.zksync.dev", + rpcUrl: "https://testnet.era.zksync.dev", }; export default (): RuntimeConfig => { diff --git a/packages/app/src/configs/index.ts b/packages/app/src/configs/index.ts index 5fa482bbae..5660e1ccdd 100644 --- a/packages/app/src/configs/index.ts +++ b/packages/app/src/configs/index.ts @@ -7,7 +7,7 @@ export type NetworkConfig = { bridgeUrl?: string; l2NetworkName: string; l2WalletUrl: string; - l2ChainId: 270 | 280 | 324 | 300; + l2ChainId: 270 | 280 | 324; l1ExplorerUrl?: string; maintenance: boolean; published: boolean; From 05236afda9e6424413be8cab81443987ba618cae Mon Sep 17 00:00:00 2001 From: pcheremu Date: Wed, 6 Dec 2023 16:17:22 +0300 Subject: [PATCH 08/16] test: sepolia for testnetSmokeSuite --- .github/workflows/app-e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/app-e2e.yml b/.github/workflows/app-e2e.yml index e288cd6a8e..d8df3ab690 100644 --- a/.github/workflows/app-e2e.yml +++ b/.github/workflows/app-e2e.yml @@ -100,7 +100,7 @@ jobs: echo "Run tests" if [ "${{ matrix.tags }}" = "@testnetSmokeSuite" ]; then echo "Run in testnetSmokeSuite only" - E2ENETWORK='/?network=goerli' npx cucumber-js --tags "${{ matrix.tags }} ${{ inputs.environmentTags }} and not @mainnet" + E2ENETWORK='/?network=sepolia' npx cucumber-js --tags "${{ matrix.tags }} ${{ inputs.environmentTags }} and not @mainnet" else echo "Run in mainnet" E2ENETWORK='${{ inputs.default_network_value_for_e2e }}' npx cucumber-js --tags "${{ matrix.tags }} ${{ inputs.environmentTags }} and not @testnet" From 210b4c9fb96a905383b067085f7026e0d72403ba Mon Sep 17 00:00:00 2001 From: pcheremu Date: Thu, 7 Dec 2023 14:04:11 +0300 Subject: [PATCH 09/16] test: switch and fix test on sepolia --- .github/workflows/app-deploy-feature-branch.yml | 3 ++- .github/workflows/app-deploy-preview.yml | 3 ++- .github/workflows/app-e2e.yml | 6 +++++- .gitignore | 2 +- .../e2e/features/artifacts/artifactsSet3.feature | 12 ++++++------ packages/app/tests/e2e/features/copying.feature | 3 ++- .../e2e/features/redirection/redirectionSet2.feature | 8 ++++---- .../e2e/features/redirection/redirectionSet3.feature | 10 +++++----- 8 files changed, 27 insertions(+), 20 deletions(-) diff --git a/.github/workflows/app-deploy-feature-branch.yml b/.github/workflows/app-deploy-feature-branch.yml index 7701b73b8a..8d3debee5a 100644 --- a/.github/workflows/app-deploy-feature-branch.yml +++ b/.github/workflows/app-deploy-feature-branch.yml @@ -66,13 +66,14 @@ jobs: mainnet: needs: build - name: Feature Env, Mainnet+ + name: Feature on Mainnet + Sepolia uses: ./.github/workflows/app-e2e.yml secrets: inherit permissions: contents: read with: targetUrl: ${{ needs.build.outputs.dappUrl }} + testnet_network_value_for_e2e: "/?network=sepolia" default_network_value_for_e2e: "/?network=mainnet" publish_to_allure: true environmentTags: "and not @productionEnv" diff --git a/.github/workflows/app-deploy-preview.yml b/.github/workflows/app-deploy-preview.yml index 1e371e4637..dc14276de3 100644 --- a/.github/workflows/app-deploy-preview.yml +++ b/.github/workflows/app-deploy-preview.yml @@ -63,13 +63,14 @@ jobs: mainnet: needs: deploy - name: Staging Env, Mainnet+ + name: Staging on Mainnet + Sepolia uses: ./.github/workflows/app-e2e.yml secrets: inherit permissions: contents: read with: targetUrl: ${{ needs.deploy.outputs.dappUrl }} + testnet_network_value_for_e2e: "/?network=sepolia" default_network_value_for_e2e: "/?network=mainnet" publish_to_allure: true environmentTags: "and not @featureEnv" diff --git a/.github/workflows/app-e2e.yml b/.github/workflows/app-e2e.yml index d8df3ab690..354c768469 100644 --- a/.github/workflows/app-e2e.yml +++ b/.github/workflows/app-e2e.yml @@ -19,6 +19,10 @@ on: type: string default: '/?network=mainnet' required: true + testnet_network_value_for_e2e: + type: string + default: '/?network=sepolia' + required: true publish_to_allure: #Here we define the variable that can be overwritten by caller workflow type: boolean description: "Publish test results to allure" @@ -100,7 +104,7 @@ jobs: echo "Run tests" if [ "${{ matrix.tags }}" = "@testnetSmokeSuite" ]; then echo "Run in testnetSmokeSuite only" - E2ENETWORK='/?network=sepolia' npx cucumber-js --tags "${{ matrix.tags }} ${{ inputs.environmentTags }} and not @mainnet" + E2ENETWORK='${{ inputs.testnet_network_value_for_e2e }}' npx cucumber-js --tags "${{ matrix.tags }} ${{ inputs.environmentTags }} and not @mainnet" else echo "Run in mainnet" E2ENETWORK='${{ inputs.default_network_value_for_e2e }}' npx cucumber-js --tags "${{ matrix.tags }} ${{ inputs.environmentTags }} and not @testnet" diff --git a/.gitignore b/.gitignore index fe4a77a6c7..ecbf0116b8 100644 --- a/.gitignore +++ b/.gitignore @@ -54,7 +54,7 @@ lerna-debug.log* !.vscode/extensions.json # Allure -/allure-results/ +**allure-results/ # App hyperchain config hyperchain.config.json diff --git a/packages/app/tests/e2e/features/artifacts/artifactsSet3.feature b/packages/app/tests/e2e/features/artifacts/artifactsSet3.feature index 2c1125ea70..cc10de46ac 100644 --- a/packages/app/tests/e2e/features/artifacts/artifactsSet3.feature +++ b/packages/app/tests/e2e/features/artifacts/artifactsSet3.feature @@ -120,7 +120,7 @@ Feature: Main Page # When I click by text "Show more transactions ->" #Then Element with "text" "self" should be "visible" - @id580 @id578 @id619 @testnet @testnetSmokeSuite + @id580 @id578 @id619 @testnet Scenario Outline: Verify label "