Browse Source

test(cypress): prefix for console log

Signed-off-by: Raju Udava <sivadstala@gmail.com>
pull/843/head
Raju Udava 3 years ago
parent
commit
4bf161f1c3
  1. 1
      scripts/cypress/integration/common/1c_sql_view.js
  2. 2
      scripts/cypress/plugins/index.js
  3. 3
      scripts/cypress/support/commands.js

1
scripts/cypress/integration/common/1c_sql_view.js

@ -66,6 +66,7 @@ export const genTest = (type, xcdb) => {
cy.openViewsTab("SalesByFilmCategory", 16); cy.openViewsTab("SalesByFilmCategory", 16);
cy.closeViewsTab("SalesByFilmCategory"); cy.closeViewsTab("SalesByFilmCategory");
// SalesByStore && StaffList contain no entries. Hence marking row count to 0
cy.openViewsTab("SalesByStore", 0); cy.openViewsTab("SalesByStore", 0);
cy.closeViewsTab("SalesByStore"); cy.closeViewsTab("SalesByStore");

2
scripts/cypress/plugins/index.js

@ -44,7 +44,7 @@ module.exports = (on, config) => {
readXlsx: readXlsx.read, readXlsx: readXlsx.read,
readSheetList: readXlsx.sheetList, readSheetList: readXlsx.sheetList,
log(message) { log(message) {
console.log(message); console.log(`##Cypress>> ${message}`);
return null; return null;
}, },
}); });

3
scripts/cypress/support/commands.js

@ -110,6 +110,8 @@ Cypress.Commands.add("openOrCreateRestProject", (_args) => {
// tn: table name // tn: table name
// rc: row count. validate row count if rc!=0 // rc: row count. validate row count if rc!=0
Cypress.Commands.add("openTableTab", (tn, rc) => { Cypress.Commands.add("openTableTab", (tn, rc) => {
cy.task("log", `[openTableTab] ${tn} ${rc}`);
cy.get(".nc-project-tree") cy.get(".nc-project-tree")
.find(".v-list-item__title:contains(Tables)", { timeout: 10000 }) .find(".v-list-item__title:contains(Tables)", { timeout: 10000 })
.should("exist") .should("exist")
@ -135,6 +137,7 @@ Cypress.Commands.add("openTableTab", (tn, rc) => {
}); });
Cypress.Commands.add("closeTableTab", (tn) => { Cypress.Commands.add("closeTableTab", (tn) => {
cy.task("log", `[closeTableTab] ${tn}`);
cy.get(`[href="#table||db||${tn}"]`).find("button.mdi-close").click(); cy.get(`[href="#table||db||${tn}"]`).find("button.mdi-close").click();
}); });

Loading…
Cancel
Save