Parcourir la source

add a new test for search page

Yuki Takei il y a 4 ans
Parent
commit
b41155b7ce

+ 1 - 1
packages/app/test/cypress/integration/2-basic-features/access-to-page.spec.ts

@@ -1,6 +1,6 @@
-const ssPrefix = 'access-to-page-';
 
 context('Access to page', () => {
+  const ssPrefix = 'access-to-page-';
 
   let connectSid: string | undefined;
 

+ 27 - 0
packages/app/test/cypress/integration/3-search/access-to-result-page-directly.spec.ts

@@ -0,0 +1,27 @@
+context('Access to search result page directly', () => {
+  const ssPrefix = 'access-to-result-page-directly-';
+
+  let connectSid: string | undefined;
+
+  before(() => {
+    // login
+    cy.fixture("user-admin.json").then(user => {
+      cy.login(user.username, user.password);
+    });
+    cy.getCookie('connect.sid').then(cookie => {
+      connectSid = cookie?.value;
+    });
+  });
+
+  beforeEach(() => {
+    if (connectSid != null) {
+      cy.setCookie('connect.sid', connectSid);
+    }
+  });
+
+  it('/_search with "q" param is successfully loaded', () => {
+    cy.visit('/_search', { qs: { q: 'sandbox headers blockquotes' } });
+    cy.screenshot(`${ssPrefix}-with-q`, { capture: 'viewport' });
+  });
+
+});