From 8a087269ee03f194ccc86998c09bb0ae88d3c055 Mon Sep 17 00:00:00 2001 From: icelandld Date: Mon, 17 Jun 2024 18:32:00 +0800 Subject: [PATCH] fix issue --- .github/workflows/main.yml | 3 --- cypress/pages/routes.js | 10 ++++++++-- cypress/pages/services.js | 10 +++++++++- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 93dd46a..c3b9d5e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,9 +33,6 @@ jobs: continue-on-error: true env: TESTS: ${{ inputs.tests }} - with: - wait-on: 'http://localhost:8002' - wait-on-timeout: 120 - name: Archive Mochawesome report uses: actions/upload-artifact@v4 diff --git a/cypress/pages/routes.js b/cypress/pages/routes.js index ff9694f..012e45b 100644 --- a/cypress/pages/routes.js +++ b/cypress/pages/routes.js @@ -5,10 +5,16 @@ const RoutesPage = { import BasePage from "./base"; import ke from "../KongBase/KongElement"; - export class Routes extends BasePage { add() { - ke.fromTAId(RoutesPage["New Route"]).click(); + cy.get('body').then($el => { + let $element = $el.find(`[data-testid="${RoutesPage["New Route"][1]}"]`); + if (!$element[0].hidden) { + ke.fromTAId(RoutesPage["New Route"][1]).click(); + } else { + ke.fromTAId(RoutesPage["New Route"][0]).click(); + } + }); } } diff --git a/cypress/pages/services.js b/cypress/pages/services.js index 9a2100b..bd25925 100644 --- a/cypress/pages/services.js +++ b/cypress/pages/services.js @@ -11,7 +11,15 @@ import BasePage from "./base"; export class Services extends BasePage { add() { - ke.fromTAId(ServicesPage["New Gateway Service"]).click() + // ke.fromTAId(ServicesPage["New Gateway Service"]).click() + cy.get('body').then($el => { + let $element = $el.find(`[data-testid="${ServicesPage["New Gateway Service"][1]}"]`); + if (!$element[0].hidden) { + ke.fromTAId(ServicesPage["New Gateway Service"][1]).click(); + } else { + ke.fromTAId(ServicesPage["New Gateway Service"][0]).click(); + } + }); } filter(context) {