This is an automated email from the ASF dual-hosted git repository.

juzhiyuan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git


The following commit(s) were added to refs/heads/master by this push:
     new e594fc0  test: add frontend e2e test (smoke test for metrics page) 
(#1104)
e594fc0 is described below

commit e594fc076f076d92b427cfef6004400a9ada301c
Author: idbeta <[email protected]>
AuthorDate: Mon Dec 28 14:12:19 2020 +0800

    test: add frontend e2e test (smoke test for metrics page) (#1104)
    
    * test: add frontend e2e test (smoke test for metrics page)
    
    * fixed wrong case title
    
    * update the key name
    
    Co-authored-by: YuanSheng Wang <[email protected]>
---
 .../integration/metrics/metrics-smoketest.spec.js  | 41 ++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/web/cypress/integration/metrics/metrics-smoketest.spec.js 
b/web/cypress/integration/metrics/metrics-smoketest.spec.js
new file mode 100644
index 0000000..21ed446
--- /dev/null
+++ b/web/cypress/integration/metrics/metrics-smoketest.spec.js
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/* eslint-disable no-undef */
+
+context('metrics page smoke test', () => {
+  const domSelectors = {
+    pageContent: '.ant-pro-page-container'
+  };
+
+  beforeEach(() => {
+    // init login 
+    cy.login();
+  })
+
+  it('visit metrics page', () => {
+    // go to metrics page
+    cy.visit('/');
+    cy.contains('Metrics').click();
+    cy.wait(500);
+    cy.url().should('contains', '/metrics');
+    cy.get(domSelectors.pageContent)
+      .children()
+      .should('contain', 'Metrics')
+      .and('contain', 'You have not configured Grafana')
+      .and('contain', 'Configure Now')
+  });
+})

Reply via email to