Browse Source

test: rebase to latest develop

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/3818/head
Raju Udava 2 years ago
parent
commit
89fa07d089
  1. 11
      packages/nc-gui/components/smartsheet-toolbar/ColumnFilter.vue
  2. 1
      packages/nc-gui/components/webhook/Editor.vue
  3. 16
      packages/nc-gui/composables/useGlobal/index.ts
  4. 5
      packages/nc-gui/composables/useGlobal/state.ts
  5. 2
      packages/nc-gui/composables/useGlobal/types.ts
  6. 4
      packages/nc-gui/composables/useViewFilters.ts
  7. 36
      scripts/cypress/integration/common/1b_table_column_operations.js
  8. 30
      scripts/cypress/integration/common/3b_formula_column.js
  9. 33
      scripts/cypress/integration/common/3c_lookup_column.js
  10. 78
      scripts/cypress/integration/common/3d_rollup_column.js
  11. 51
      scripts/cypress/integration/common/3e_duration_column.js
  12. 20
      scripts/cypress/integration/common/3f_link_to_another_record.js
  13. 40
      scripts/cypress/support/commands.js
  14. 372
      scripts/cypress/support/page_objects/mainPage.js

11
packages/nc-gui/components/smartsheet-toolbar/ColumnFilter.vue

@ -23,9 +23,10 @@ interface Props {
hookId?: string hookId?: string
showLoading?: boolean showLoading?: boolean
modelValue?: Filter[] modelValue?: Filter[]
webHook?: boolean
} }
const { nested = false, parentId, autoSave = true, hookId = null, modelValue, showLoading = true } = defineProps<Props>() const { nested = false, parentId, autoSave = true, hookId = null, modelValue, showLoading = true, webHook } = defineProps<Props>()
const emit = defineEmits(['update:filtersLength']) const emit = defineEmits(['update:filtersLength'])
@ -101,13 +102,13 @@ const types = computed(() => {
watch( watch(
() => activeView.value?.id, () => activeView.value?.id,
(n, o) => { (n, o) => {
if (n !== o) loadFilters(hookId as string) if (n !== o && (hookId || !webHook)) loadFilters(hookId as string)
}, },
{ immediate: true }, { immediate: true },
) )
watch( watch(
() => filters.value.length, () => filters.value.length ,
(length) => { (length) => {
emit('update:filtersLength', length ?? 0) emit('update:filtersLength', length ?? 0)
}, },
@ -137,7 +138,7 @@ defineExpose({
:class="{ 'shadow min-w-[430px] max-w-[630px] max-h-[max(80vh,500px)] overflow-auto': !nested, 'border-1 w-full': nested }" :class="{ 'shadow min-w-[430px] max-w-[630px] max-h-[max(80vh,500px)] overflow-auto': !nested, 'border-1 w-full': nested }"
> >
<div v-if="filters && filters.length" class="nc-filter-grid mb-2" @click.stop> <div v-if="filters && filters.length" class="nc-filter-grid mb-2" @click.stop>
<template v-for="(filter, i) in filters" :key="filter.id || i"> <template v-for="(filter, i) in filters" :key="i">
<template v-if="filter.status !== 'delete'"> <template v-if="filter.status !== 'delete'">
<template v-if="filter.is_group"> <template v-if="filter.is_group">
<MdiCloseBox <MdiCloseBox
@ -280,7 +281,7 @@ defineExpose({
{{ $t('activity.addFilter') }} {{ $t('activity.addFilter') }}
</div> </div>
</a-button> </a-button>
<a-button class="text-capitalize !text-gray-500" @click.stop="addFilterGroup"> <a-button class="text-capitalize !text-gray-500" v-if="!webHook" @click.stop="addFilterGroup">
<div class="flex items-center gap-1"> <div class="flex items-center gap-1">
<!-- <v-icon small color="grey"> mdi-plus </v-icon> --> <!-- <v-icon small color="grey"> mdi-plus </v-icon> -->
<!-- Add Filter Group --> <!-- Add Filter Group -->

1
packages/nc-gui/components/webhook/Editor.vue

@ -619,6 +619,7 @@ onMounted(async () => {
:auto-save="false" :auto-save="false"
:show-loading="false" :show-loading="false"
:hook-id="hook.id" :hook-id="hook.id"
web-hook
/> />
</a-card> </a-card>
</a-col> </a-col>

16
packages/nc-gui/composables/useGlobal/index.ts

@ -62,6 +62,22 @@ export const useGlobal = (): UseGlobalReturn => {
{ immediate: true }, { immediate: true },
) )
watch(
state.jwtPayload,
(nextPayload) => {
if (nextPayload) {
state.user.value = {
id: nextPayload.id,
email: nextPayload.email,
firstname: nextPayload.firstname,
lastname: nextPayload.lastname,
roles: nextPayload.roles,
}
}
},
{ immediate: true },
)
const globalState = { ...state, ...getters, ...actions } as UseGlobalReturn const globalState = { ...state, ...getters, ...actions } as UseGlobalReturn
/** provide a fresh state instance into nuxt app */ /** provide a fresh state instance into nuxt app */

5
packages/nc-gui/composables/useGlobal/state.ts

@ -49,7 +49,6 @@ export function useGlobalState(storageKey = 'nocodb-gui-v2'): State {
/** State */ /** State */
const initialState: StoredState = { const initialState: StoredState = {
token: null, token: null,
user: null,
lang: preferredLanguage, lang: preferredLanguage,
darkMode: prefersDarkMode, darkMode: prefersDarkMode,
feedbackForm: { feedbackForm: {
@ -102,6 +101,9 @@ export function useGlobalState(storageKey = 'nocodb-gui-v2'): State {
/** global error */ /** global error */
const error = ref() const error = ref()
/** our local user object */
const user = ref<User | null>(null)
return { return {
...toRefs(storage.value), ...toRefs(storage.value),
storage, storage,
@ -110,6 +112,7 @@ export function useGlobalState(storageKey = 'nocodb-gui-v2'): State {
timestamp, timestamp,
runningRequests, runningRequests,
error, error,
user,
appInfo, appInfo,
} }
} }

2
packages/nc-gui/composables/useGlobal/types.ts

@ -29,7 +29,6 @@ export interface AppInfo {
export interface StoredState { export interface StoredState {
token: string | null token: string | null
user: User | null
lang: keyof typeof Language lang: keyof typeof Language
darkMode: boolean darkMode: boolean
feedbackForm: FeedbackForm feedbackForm: FeedbackForm
@ -43,6 +42,7 @@ export interface StoredState {
export type State = ToRefs<Omit<StoredState, 'token'>> & { export type State = ToRefs<Omit<StoredState, 'token'>> & {
storage: Ref<StoredState> storage: Ref<StoredState>
user: Ref<User | null>
token: WritableComputedRef<StoredState['token']> token: WritableComputedRef<StoredState['token']>
jwtPayload: ComputedRef<(JwtPayload & User) | null> jwtPayload: ComputedRef<(JwtPayload & User) | null>
timestamp: Ref<number> timestamp: Ref<number>

4
packages/nc-gui/composables/useViewFilters.ts

@ -183,12 +183,12 @@ export function useViewFilters(
} }
const addFilter = () => { const addFilter = () => {
filters.value.push(placeholderFilter) filters.value.push({ ...placeholderFilter })
$e('a:filter:add', { length: filters.value.length }) $e('a:filter:add', { length: filters.value.length })
} }
const addFilterGroup = async () => { const addFilterGroup = async () => {
const child = placeholderFilter const child = { ...placeholderFilter }
const placeHolderGroupFilter: Filter = { const placeHolderGroupFilter: Filter = {
is_group: true, is_group: true,
status: 'create', status: 'create',

36
scripts/cypress/integration/common/1b_table_column_operations.js

@ -65,13 +65,26 @@ export const genTest = (apiType, dbType) => {
.trigger("mouseover", { force: true }) .trigger("mouseover", { force: true })
.click({ force: true }); .click({ force: true });
cy.get(".nc-column-edit").click(); // cy.get(".nc-column-edit").click();
cy.get(".nc-column-edit").should("not.be.visible"); // cy.get(".nc-column-edit").should("not.be.visible");
cy.getActiveMenu(".nc-dropdown-column-operations")
.find(".nc-column-edit")
.click();
// change column type and verify // change column type and verify
cy.get(".nc-column-type-input").last().click(); // cy.get(".nc-column-type-input").last().click();
cy.getActiveSelection('.nc-dropdown-column-type').find('.ant-select-item-option').contains("LongText").click(); cy.getActiveMenu('.nc-dropdown-edit-column')
cy.get(".ant-btn-primary:visible").contains("Save").click(); .find(".nc-column-type-input")
.last()
.click();
cy.getActiveSelection('.nc-dropdown-column-type')
.find('.ant-select-item-option')
.contains("LongText")
.click();
cy.getActiveMenu('.nc-dropdown-edit-column')
.find(".ant-btn-primary:visible")
.contains("Save")
.click();
cy.toastWait("Column updated"); cy.toastWait("Column updated");
} }
@ -83,15 +96,22 @@ export const genTest = (apiType, dbType) => {
.trigger("mouseover", { force: true }) .trigger("mouseover", { force: true })
.click({ force: true }); .click({ force: true });
cy.get(".nc-column-edit").click(); // cy.get(".nc-column-edit").click();
cy.get(".nc-column-edit").should("not.be.visible"); // cy.get(".nc-column-edit").should("not.be.visible");
cy.getActiveMenu(".nc-dropdown-column-operations")
.find(".nc-column-edit")
.click();
// rename column and verify // rename column and verify
cy.getActiveMenu(".nc-dropdown-edit-column").find('input.nc-column-name-input', { timeout: 3000 }) cy.getActiveMenu(".nc-dropdown-edit-column").find('input.nc-column-name-input', { timeout: 3000 })
.should('exist') .should('exist')
.clear() .clear()
.type(updatedColName); .type(updatedColName);
cy.get(".ant-btn-primary:visible").contains("Save").click(); // cy.get(".ant-btn-primary:visible").contains("Save").click();
cy.getActiveMenu('.nc-dropdown-edit-column')
.find(".ant-btn-primary:visible")
.contains("Save")
.click();
cy.toastWait("Column updated"); cy.toastWait("Column updated");

30
scripts/cypress/integration/common/3b_formula_column.js

@ -57,10 +57,25 @@ export const genTest = (apiType, dbType) => {
.should('exist') .should('exist')
.clear() .clear()
.type(columnName); .type(columnName);
cy.get(".nc-column-type-input").last().click().type("Formula"); // cy.get(".nc-column-type-input").last().click().type("Formula");
cy.getActiveSelection('.nc-dropdown-column-type').find('.ant-select-item-option').contains("Formula").click(); cy.getActiveMenu('.nc-dropdown-grid-add-column')
cy.get('textarea.nc-formula-input').click().type(formula, { parseSpecialCharSequences: false }); .find(".nc-column-type-input")
cy.get(".ant-btn-primary").contains("Save").should('exist').click(); .last()
.click()
.type("Formula");
cy.getActiveSelection('.nc-dropdown-column-type')
.find('.ant-select-item-option')
.contains("Formula")
.click();
cy.getActiveMenu('.nc-dropdown-grid-add-column')
.find('textarea.nc-formula-input')
.click()
.type(formula, { parseSpecialCharSequences: false });
// cy.get(".ant-btn-primary").contains("Save").should('exist').click();
cy.getActiveMenu('.nc-dropdown-grid-add-column')
.find(".ant-btn-primary:visible")
.contains("Save")
.click();
// cy.toastWait(`Column created`); // cy.toastWait(`Column created`);
cy.closeTableTab("City"); cy.closeTableTab("City");
@ -82,8 +97,11 @@ export const genTest = (apiType, dbType) => {
.trigger("mouseover", { force: true }) .trigger("mouseover", { force: true })
.click({ force: true }); .click({ force: true });
cy.get(".nc-column-edit").click(); // cy.get(".nc-column-edit").click();
cy.get(".nc-column-edit").should("not.be.visible"); // cy.get(".nc-column-edit").should("not.be.visible");
cy.getActiveMenu(".nc-dropdown-column-operations")
.find(".nc-column-edit")
.click();
cy.getActiveMenu(".nc-dropdown-edit-column").find('input.nc-column-name-input', { timeout: 3000 }) cy.getActiveMenu(".nc-dropdown-edit-column").find('input.nc-column-name-input', { timeout: 3000 })
.should('exist') .should('exist')

33
scripts/cypress/integration/common/3c_lookup_column.js

@ -48,21 +48,40 @@ export const genTest = (apiType, dbType) => {
force: true, force: true,
}); });
cy.getActiveMenu(".nc-dropdown-grid-add-column").find('input.nc-column-name-input', { timeout: 3000 }) cy.getActiveMenu(".nc-dropdown-grid-add-column")
.find('input.nc-column-name-input')
.should('exist') .should('exist')
.clear() .clear()
.type(childCol); .type(childCol);
cy.get(".nc-column-type-input").last().click().type("Lookup"); // cy.get(".nc-column-type-input").last().click().type("Lookup");
cy.getActiveSelection('.nc-dropdown-column-type').find('.ant-select-item-option').contains("Lookup").click(); cy.getActiveMenu('.nc-dropdown-grid-add-column')
.find(".nc-column-type-input")
.last()
.click()
.type("Lookup");
cy.getActiveSelection('.nc-dropdown-column-type')
.find('.ant-select-item-option')
.contains("Lookup")
.click();
// Configure Child table & column names // Configure Child table & column names
fetchParentFromLabel("Child table"); fetchParentFromLabel("Child table");
cy.getActiveSelection('.nc-dropdown-relation-table').find('.ant-select-item-option').contains(childTable).click(); cy.getActiveSelection('.nc-dropdown-relation-table')
.find('.ant-select-item-option')
.contains(childTable)
.click();
fetchParentFromLabel("Child column"); fetchParentFromLabel("Child column");
cy.getActiveSelection('.nc-dropdown-relation-column').find('.ant-select-item-option').contains(childCol).click(); cy.getActiveSelection('.nc-dropdown-relation-column')
.find('.ant-select-item-option')
cy.get(".ant-btn-primary").contains("Save").should('exist').click(); .contains(childCol)
.click();
// cy.get(".ant-btn-primary").contains("Save").should('exist').click();
cy.getActiveMenu('.nc-dropdown-grid-add-column')
.find(".ant-btn-primary:visible")
.contains("Save")
.click();
cy.toastWait(`Column created`); cy.toastWait(`Column created`);
cy.get(`th[data-title="${childCol}"]`).should("exist"); cy.get(`th[data-title="${childCol}"]`).should("exist");

78
scripts/cypress/integration/common/3d_rollup_column.js

@ -54,24 +54,46 @@ export const genTest = (apiType, dbType) => {
force: true, force: true,
}); });
cy.getActiveMenu(".nc-dropdown-grid-add-column").find('input.nc-column-name-input', { timeout: 3000 }) cy.getActiveMenu(".nc-dropdown-grid-add-column")
.find('input.nc-column-name-input')
.should('exist') .should('exist')
.clear() .clear()
.type(columnName); .type(columnName);
cy.get(".nc-column-type-input").last().click().type("RollUp"); // cy.get(".nc-column-type-input").last().click().type("RollUp");
cy.getActiveSelection('.nc-dropdown-column-type').find('.ant-select-item-option').contains("Rollup").click(); cy.getActiveMenu('.nc-dropdown-grid-add-column')
.find(".nc-column-type-input")
.last()
.click()
.type("RollUp")
cy.getActiveSelection('.nc-dropdown-column-type')
.find('.ant-select-item-option')
.contains("Rollup")
.click();
// Configure Child table & column names // Configure Child table & column names
fetchParentFromLabel("Child table"); fetchParentFromLabel("Child table");
cy.getActiveSelection('.nc-dropdown-relation-table').find('.ant-select-item-option').contains(childTable).click(); cy.getActiveSelection('.nc-dropdown-relation-table')
.find('.ant-select-item-option')
.contains(childTable)
.click();
fetchParentFromLabel("Child column"); fetchParentFromLabel("Child column");
cy.getActiveSelection('.nc-dropdown-relation-column').find('.ant-select-item-option').contains(childCol).click(); cy.getActiveSelection('.nc-dropdown-relation-column')
.find('.ant-select-item-option')
.contains(childCol)
.click();
fetchParentFromLabel("Aggregate function"); fetchParentFromLabel("Aggregate function");
cy.getActiveSelection('.nc-dropdown-rollup-function').find('.ant-select-item-option').contains(aggregateFunc).click(); cy.getActiveSelection('.nc-dropdown-rollup-function')
.find('.ant-select-item-option')
.contains(aggregateFunc)
.click();
cy.get(".ant-btn-primary").contains("Save").should('exist').click(); // cy.get(".ant-btn-primary").contains("Save").should('exist').click();
cy.getActiveMenu('.nc-dropdown-grid-add-column')
.find(".ant-btn-primary:visible")
.contains("Save")
.click();
cy.toastWait(`Column created`); cy.toastWait(`Column created`);
cy.get(`th[data-title="${columnName}"]`).should("exist"); cy.get(`th[data-title="${columnName}"]`).should("exist");
@ -85,26 +107,26 @@ export const genTest = (apiType, dbType) => {
// routine to edit column // routine to edit column
// //
const editColumnByName = (oldName, newName) => { // const editColumnByName = (oldName, newName) => {
// verify if column exists before delete // // verify if column exists before delete
cy.get(`th:contains(${oldName})`).should("exist"); // cy.get(`th:contains(${oldName})`).should("exist");
//
// delete opiton visible on mouse-over // // delete opiton visible on mouse-over
cy.get(`th:contains(${oldName}) .mdi-menu-down`) // cy.get(`th:contains(${oldName}) .mdi-menu-down`)
.trigger("mouseover") // .trigger("mouseover")
.click(); // .click();
//
// edit/ save on pop-up // // edit/ save on pop-up
cy.get(".nc-column-edit").click(); // cy.get(".nc-column-edit").click();
cy.get(".nc-column-name-input input").clear().type(newName); // cy.get(".nc-column-name-input input").clear().type(newName);
cy.get(".nc-col-create-or-edit-card").contains("Save").click(); // cy.get(".nc-col-create-or-edit-card").contains("Save").click();
//
cy.toastWait("Successfully updated alias"); // cy.toastWait("Successfully updated alias");
//
// validate if deleted (column shouldnt exist) // // validate if deleted (column shouldnt exist)
cy.get(`th:contains(${oldName})`).should("not.exist"); // cy.get(`th:contains(${oldName})`).should("not.exist");
cy.get(`th:contains(${newName})`).should("exist"); // cy.get(`th:contains(${newName})`).should("exist");
}; // };
/////////////////////////////////////////////////// ///////////////////////////////////////////////////
// Test case // Test case
@ -134,7 +156,7 @@ export const genTest = (apiType, dbType) => {
.contains("2") .contains("2")
.should("exist"); .should("exist");
editColumnByName("RollUpCol_1", "RollUpCol_New"); // editColumnByName("RollUpCol_1", "RollUpCol_New");
deleteColumnByName("RollUpCol_New"); deleteColumnByName("RollUpCol_New");
}); });
}); });

51
scripts/cypress/integration/common/3e_duration_column.js

@ -44,18 +44,34 @@ export const genTest = (apiType, dbType) => {
force: true, force: true,
}); });
cy.getActiveMenu(".nc-dropdown-grid-add-column").find('input.nc-column-name-input', { timeout: 3000 }) cy.getActiveMenu(".nc-dropdown-grid-add-column")
.find('input.nc-column-name-input', { timeout: 3000 })
.should('exist') .should('exist')
.clear() .clear()
.type(columnName); .type(columnName);
cy.get(".nc-column-type-input").last().click().type("Duration"); // cy.get(".nc-column-type-input").last().click().type("Duration");
cy.getActiveSelection('.nc-dropdown-column-type').find('.ant-select-item-option').contains("Duration").click(); cy.getActiveMenu('.nc-dropdown-grid-add-column')
.find(".nc-column-type-input")
.last()
.click()
.type("Duration")
cy.getActiveSelection('.nc-dropdown-column-type')
.find('.ant-select-item-option')
.contains("Duration")
.click();
// Configure Duration format // Configure Duration format
fetchParentFromLabel("Duration Format"); fetchParentFromLabel("Duration Format");
cy.getActiveSelection('.nc-dropdown-duration-option').find('.ant-select-item-option').contains(durationFormat).click(); cy.getActiveSelection('.nc-dropdown-duration-option')
.find('.ant-select-item-option')
cy.get(".ant-btn-primary").contains("Save").should('exist').click(); .contains(durationFormat)
.click();
// cy.get(".ant-btn-primary").contains("Save").should('exist').click();
cy.getActiveMenu('.nc-dropdown-grid-add-column')
.find(".ant-btn-primary:visible")
.contains("Save")
.click();
cy.toastWait(`Column created`); cy.toastWait(`Column created`);
cy.get(`th[data-title="${columnName}"]`).should("exist"); cy.get(`th[data-title="${columnName}"]`).should("exist");
@ -75,19 +91,30 @@ export const genTest = (apiType, dbType) => {
.trigger("mouseover", { force: true }) .trigger("mouseover", { force: true })
.click({ force: true }); .click({ force: true });
cy.get(".nc-column-edit").click(); // cy.get(".nc-column-edit").click();
cy.get(".nc-column-edit").should("not.be.visible"); // cy.get(".nc-column-edit").should("not.be.visible");
cy.getActiveMenu(".nc-dropdown-column-operations")
.find(".nc-column-edit")
.click();
// rename column and verify // rename column and verify
cy.getActiveMenu(".nc-dropdown-column-operations").find('input.nc-column-name-input', { timeout: 3000 }) cy.getActiveMenu(".nc-dropdown-edit-column")
.find('input.nc-column-name-input', { timeout: 3000 })
.should('exist') .should('exist')
.clear() .clear()
.type(newName); .type(newName);
// Configure Duration format // Configure Duration format
fetchParentFromLabel("Duration Format"); fetchParentFromLabel("Duration Format");
cy.getActiveSelection('.nc-dropdown-duration-option').find('.ant-select-item-option').contains(newDurationFormat).click(); cy.getActiveSelection('.nc-dropdown-duration-option')
.find('.ant-select-item-option')
cy.get(".ant-btn-primary:visible").contains("Save").click(); .contains(newDurationFormat)
.click();
// cy.get(".ant-btn-primary:visible").contains("Save").click();
cy.getActiveMenu('.nc-dropdown-edit-column')
.find(".ant-btn-primary:visible")
.contains("Save")
.click();
cy.toastWait("Column updated"); cy.toastWait("Column updated");

20
scripts/cypress/integration/common/3f_link_to_another_record.js

@ -37,12 +37,18 @@ export const genTest = (apiType, dbType) => {
.type(columnName); .type(columnName);
// Column type // Column type
cy.get(".nc-column-type-input").last() // cy.get(".nc-column-type-input").last()
// .click()
// .type("Link");
cy.getActiveMenu('.nc-dropdown-grid-add-column')
.find(".nc-column-type-input")
.last()
.click() .click()
.type("Link"); .type("Link")
cy.getActiveSelection('.nc-dropdown-column-type') cy.getActiveSelection('.nc-dropdown-column-type')
.find('.ant-select-item-option') .find('.ant-select-item-option')
.contains("LinkToAnotherRecord").click(); .contains("LinkToAnotherRecord")
.click();
// relation type (hm/ mm) // relation type (hm/ mm)
cy.get('.nc-ltar-relation-type') cy.get('.nc-ltar-relation-type')
@ -62,9 +68,13 @@ export const genTest = (apiType, dbType) => {
.click(); .click();
// Save // Save
cy.get(".ant-btn-primary") // cy.get(".ant-btn-primary")
// .contains("Save")
// .should('exist')
// .click();
cy.getActiveMenu('.nc-dropdown-grid-add-column')
.find(".ant-btn-primary:visible")
.contains("Save") .contains("Save")
.should('exist')
.click(); .click();
// Toast // Toast

40
scripts/cypress/support/commands.js

@ -352,26 +352,26 @@ Cypress.Commands.add('renameTable', (oldName, newName) => {
}); });
Cypress.Commands.add('createColumn', (table, columnName) => { // Cypress.Commands.add('createColumn', (table, columnName) => {
cy.get('.nc-project-tree') // cy.get('.nc-project-tree')
.find('.v-list-item__title:contains(Tables)') // .find('.v-list-item__title:contains(Tables)')
.should('exist') // .should('exist')
.first() // .first()
.click(); // .click();
cy.get('.nc-project-tree') // cy.get('.nc-project-tree')
.contains(table) // .contains(table)
.should('exist') // .should('exist')
.first() // .first()
.click({ force: true }); // .click({ force: true });
cy.get(`.project-tab:contains(${table}):visible`).should('exist'); // cy.get(`.project-tab:contains(${table}):visible`).should('exist');
cy.get('.v-window-item--active .nc-grid tr > th:last button').click({ // cy.get('.v-window-item--active .nc-grid tr > th:last button').click({
force: true, // force: true,
}); // });
cy.get('.nc-column-name-input input').clear().type(columnName); // cy.get('.nc-column-name-input input').clear().type(columnName);
cy.getActiveMenu('Menu_CreateColumn'); // cy.getActiveMenu('Menu_CreateColumn');
cy.get('.nc-col-create-or-edit-card').contains('Save').click(); // cy.get('.nc-col-create-or-edit-card').contains('Save').click();
cy.get('th:contains(new_column)').should('exist'); // cy.get('th:contains(new_column)').should('exist');
}); // });
Cypress.Commands.add('toastWait', (msg) => { Cypress.Commands.add('toastWait', (msg) => {
cy.get('.ant-message-notice-content:visible', { timeout: 60000 }).contains(msg).should('exist'); cy.get('.ant-message-notice-content:visible', { timeout: 60000 }).contains(msg).should('exist');

372
scripts/cypress/support/page_objects/mainPage.js

@ -32,28 +32,30 @@ export class _settingsPage {
// open settings tab // open settings tab
// cy.get('.nc-team-settings').should('exist').click() // cy.get('.nc-team-settings').should('exist').click()
// cy.get(`[data-menu-id=${menuId}]`).should('exist').click() // cy.get(`[data-menu-id=${menuId}]`).should('exist').click()
cy.get('.nc-project-menu').should('exist').click() cy.get(".nc-project-menu").should("exist").click();
cy.getActiveMenu(".nc-dropdown-project-menu").find(`[data-menu-id="teamAndSettings"]`).should('exist').click() cy.getActiveMenu(".nc-dropdown-project-menu")
cy.get(`[data-menu-id=${menuId}]`).should('exist').click() .find(`[data-menu-id="teamAndSettings"]`)
.should("exist")
.click();
cy.get(`[data-menu-id=${menuId}]`).should("exist").click();
} }
openTab(tabId) { openTab(tabId) {
cy.get(`[data-menu-id=${tabId}]`).should('exist').last().click() cy.get(`[data-menu-id=${tabId}]`).should("exist").last().click();
} }
closeMenu() { closeMenu() {
cy.getActiveModal().find('.nc-modal-close').click({ force: true }); cy.getActiveModal().find(".nc-modal-close").click({ force: true });
} }
openProjectMenu() { openProjectMenu() {
cy.get('.nc-project-menu').should('exist').click() cy.get(".nc-project-menu").should("exist").click();
} }
} }
// main page // main page
export class _mainPage { export class _mainPage {
constructor() { constructor() {
// Top Left items // Top Left items
this.HOME = 0; this.HOME = 0;
@ -88,8 +90,11 @@ export class _mainPage {
navigationDraw(item) { navigationDraw(item) {
// open settings tab // open settings tab
cy.get('.nc-project-menu').should('exist').click() cy.get(".nc-project-menu").should("exist").click();
cy.getActiveMenu(".nc-dropdown-project-menu").find(`[data-menu-id="teamAndSettings"]`).should('exist').click() cy.getActiveMenu(".nc-dropdown-project-menu")
.find(`[data-menu-id="teamAndSettings"]`)
.should("exist")
.click();
switch (item) { switch (item) {
case this.AUDIT: case this.AUDIT:
@ -107,20 +112,27 @@ export class _mainPage {
// //
addNewUserToProject = (userCred, roleType) => { addNewUserToProject = (userCred, roleType) => {
let linkText; let linkText;
let roleIndex = ["creator", "editor", "commenter", "viewer"].indexOf(roleType) let roleIndex = ["creator", "editor", "commenter", "viewer"].indexOf(
roleType
);
// click on New User button, feed details // click on New User button, feed details
cy.get('button.nc-invite-team').click(); cy.get("button.nc-invite-team").click();
cy.get('input[placeholder="E-mail"]') cy.get('input[placeholder="E-mail"]').type(userCred.username);
.type(userCred.username)
cy.get('.ant-select.nc-user-roles').click(); cy.get(".ant-select.nc-user-roles").click();
// opt-in requested role & submit // opt-in requested role & submit
// cy.getActiveSelection().contains(roleType).click({force: true}); // cy.getActiveSelection().contains(roleType).click({force: true});
cy.getActiveSelection('.nc-dropdown-user-role').find('.nc-role-option').eq(roleIndex).should('exist').click() cy.getActiveSelection(".nc-dropdown-user-role")
cy.getActiveModal(".nc-modal-invite-user-and-share-base").find("button.ant-btn-primary").click(); .find(".nc-role-option")
.eq(roleIndex)
.should("exist")
.click();
cy.getActiveModal(".nc-modal-invite-user-and-share-base")
.find("button.ant-btn-primary")
.click();
cy.toastWait("Successfully updated the user details"); cy.toastWait("Successfully updated the user details");
@ -158,9 +170,9 @@ export class _mainPage {
// }; // };
getCell = (columnHeader, cellNumber) => { getCell = (columnHeader, cellNumber) => {
return cy.get( return cy
`:nth-child(${cellNumber}) > [data-title="${columnHeader}"]` .get(`:nth-child(${cellNumber}) > [data-title="${columnHeader}"]`)
).last(); .last();
}; };
getPagination = (pageNumber) => { getPagination = (pageNumber) => {
@ -183,11 +195,16 @@ export class _mainPage {
force: true, force: true,
}); });
cy.getActiveMenu(".nc-dropdown-grid-add-column").find('input.nc-column-name-input', { timeout: 3000 }) cy.getActiveMenu(".nc-dropdown-grid-add-column")
.should('exist') .find("input.nc-column-name-input")
.should("exist")
.clear() .clear()
.type(colName); .type(colName);
cy.get(".ant-btn-primary").contains("Save").should('exist').click(); cy.getActiveMenu(".nc-dropdown-grid-add-column")
.find(".ant-btn-primary")
.contains("Save")
.should("exist")
.click();
cy.toastWait(`Column created`); cy.toastWait(`Column created`);
cy.get(`th[data-title="${colName}"]`).should("exist"); cy.get(`th[data-title="${colName}"]`).should("exist");
}; };
@ -197,15 +214,27 @@ export class _mainPage {
force: true, force: true,
}); });
cy.getActiveMenu(".nc-dropdown-grid-add-column").find('input.nc-column-name-input', { timeout: 3000 }) cy.getActiveMenu(".nc-dropdown-grid-add-column")
.should('exist') .find("input.nc-column-name-input")
.should("exist")
.clear() .clear()
.type(colName); .type(colName);
// change column type and verify // change column type and verify
cy.get(".nc-column-type-input").last().click(); // cy.get(".nc-column-type-input").last().click();
cy.getActiveSelection('.nc-dropdown-column-type').find('.ant-select-item-option').contains(colType).click(); cy.getActiveMenu(".nc-dropdown-grid-add-column")
cy.get(".ant-btn-primary:visible").contains("Save").click(); .find(".nc-column-type-input")
.last()
.click();
cy.getActiveSelection(".nc-dropdown-column-type")
.find(".ant-select-item-option")
.contains(colType)
.click();
// cy.get(".ant-btn-primary:visible").contains("Save").click();
cy.getActiveMenu(".nc-dropdown-grid-add-column")
.find(".ant-btn-primary:visible")
.contains("Save")
.click();
cy.toastWait(`Column created`); cy.toastWait(`Column created`);
cy.get(`th[data-title="${colName}"]`).should("exist"); cy.get(`th[data-title="${colName}"]`).should("exist");
@ -218,13 +247,13 @@ export class _mainPage {
.trigger("mouseover", { force: true }) .trigger("mouseover", { force: true })
.click({ force: true }); .click({ force: true });
cy.wait(500) cy.wait(500);
cy.get(".nc-column-delete").click(); cy.get(".nc-column-delete").click();
cy.wait(500) cy.wait(500);
cy.get(".nc-column-delete").should("not.be.visible"); cy.get(".nc-column-delete").should("not.be.visible");
cy.get(".ant-btn-dangerous:visible").contains("Delete").click(); cy.get(".ant-btn-dangerous:visible").contains("Delete").click();
cy.wait(500) cy.wait(500);
cy.get(`th:contains(${colName})`).should("not.exist"); cy.get(`th:contains(${colName})`).should("not.exist");
}; };
@ -235,28 +264,48 @@ export class _mainPage {
}; };
configureSMTP = (from, host, port, secure) => { configureSMTP = (from, host, port, secure) => {
cy.getActiveModal().find('.nc-app-store-card-SMTP').click().then((obj) => { cy.getActiveModal()
cy.wrap(obj).find('.nc-app-store-card-install').click({ force: true }); .find(".nc-app-store-card-SMTP")
}) .click()
.then((obj) => {
cy.wrap(obj).find(".nc-app-store-card-install").click({ force: true });
});
cy.getActiveModal().find('#form_item_from').should('exist').clear().type(from) cy.getActiveModal()
cy.getActiveModal().find('#form_item_host').should('exist').clear().type(host) .find("#form_item_from")
cy.getActiveModal().find('#form_item_port').should('exist').clear().type(port) .should("exist")
.clear()
.type(from);
cy.getActiveModal()
.find("#form_item_host")
.should("exist")
.clear()
.type(host);
cy.getActiveModal()
.find("#form_item_port")
.should("exist")
.clear()
.type(port);
// cy.getActiveModal().find('#form_item_secure').should('exist').clear().type(secure) // cy.getActiveModal().find('#form_item_secure').should('exist').clear().type(secure)
cy.getActiveModal().find("button").contains("Save").click(); cy.getActiveModal().find("button").contains("Save").click();
cy.toastWait('Successfully installed and email notification will use SMTP configuration'); cy.toastWait(
settingsPage.closeMenu() "Successfully installed and email notification will use SMTP configuration"
);
settingsPage.closeMenu();
}; };
resetSMTP = () => { resetSMTP = () => {
cy.getActiveModal().find('.nc-app-store-card-SMTP').click().then((obj) => { cy.getActiveModal()
cy.wrap(obj).find('.nc-app-store-card-reset').click({ force: true }); .find(".nc-app-store-card-SMTP")
}) .click()
.then((obj) => {
cy.wrap(obj).find(".nc-app-store-card-reset").click({ force: true });
});
cy.getActiveModal().find("button").contains("Confirm").click(); cy.getActiveModal().find("button").contains("Confirm").click();
cy.toastWait("Plugin uninstalled successfully"); cy.toastWait("Plugin uninstalled successfully");
settingsPage.closeMenu() settingsPage.closeMenu();
}; };
shareView = () => { shareView = () => {
@ -264,138 +313,183 @@ export class _mainPage {
}; };
shareViewList = () => { shareViewList = () => {
cy.get(".nc-actions-menu-btn").should('exist').click(); cy.get(".nc-actions-menu-btn").should("exist").click();
return cy.getActiveMenu(".nc-dropdown-actions-menu").find('.ant-dropdown-menu-item').contains('Shared View List'); return cy
.getActiveMenu(".nc-dropdown-actions-menu")
.find(".ant-dropdown-menu-item")
.contains("Shared View List");
}; };
downloadCsv = () => { downloadCsv = () => {
cy.get(".nc-actions-menu-btn").should('exist').click(); cy.get(".nc-actions-menu-btn").should("exist").click();
return cy.getActiveMenu(".nc-dropdown-actions-menu").find('.ant-dropdown-menu-item').contains('Download as CSV'); return cy
.getActiveMenu(".nc-dropdown-actions-menu")
.find(".ant-dropdown-menu-item")
.contains("Download as CSV");
}; };
downloadExcel = () => { downloadExcel = () => {
cy.get(".nc-actions-menu-btn").should('exist').click(); cy.get(".nc-actions-menu-btn").should("exist").click();
return cy.getActiveMenu(".nc-dropdown-actions-menu").find('.ant-dropdown-menu-item').contains('Download as XLSX'); return cy
.getActiveMenu(".nc-dropdown-actions-menu")
.find(".ant-dropdown-menu-item")
.contains("Download as XLSX");
}; };
uploadCsv = () => { uploadCsv = () => {
cy.get(".nc-actions-menu-btn").should('exist').click(); cy.get(".nc-actions-menu-btn").should("exist").click();
return cy.getActiveMenu(".nc-dropdown-actions-menu").find('.ant-dropdown-menu-item').contains('Upload CSV'); return cy
.getActiveMenu(".nc-dropdown-actions-menu")
.find(".ant-dropdown-menu-item")
.contains("Upload CSV");
}; };
automations = () => { automations = () => {
cy.get(".nc-actions-menu-btn").should('exist').click(); cy.get(".nc-actions-menu-btn").should("exist").click();
return cy.getActiveMenu(".nc-dropdown-actions-menu").find('.ant-dropdown-menu-item').contains('Webhooks'); return cy
.getActiveMenu(".nc-dropdown-actions-menu")
.find(".ant-dropdown-menu-item")
.contains("Webhooks");
}; };
hideAllColumns = () => { hideAllColumns = () => {
cy.get(".nc-fields-menu-btn").should('exist').click(); cy.get(".nc-fields-menu-btn").should("exist").click();
cy.getActiveMenu(".nc-dropdown-fields-menu").find('.ant-btn').contains('Hide all').click(); cy.getActiveMenu(".nc-dropdown-fields-menu")
cy.get(".nc-fields-menu-btn").should('exist').click(); .find(".ant-btn")
} .contains("Hide all")
.click();
cy.get(".nc-fields-menu-btn").should("exist").click();
};
showAllColumns = () => { showAllColumns = () => {
cy.get(".nc-fields-menu-btn").should('exist').click(); cy.get(".nc-fields-menu-btn").should("exist").click();
cy.getActiveMenu(".nc-dropdown-fields-menu").find('.ant-btn').contains('Show all').click(); cy.getActiveMenu(".nc-dropdown-fields-menu")
cy.get(".nc-fields-menu-btn").should('exist').click(); .find(".ant-btn")
} .contains("Show all")
.click();
cy.get(".nc-fields-menu-btn").should("exist").click();
};
toggleShowSystemFields = () => { toggleShowSystemFields = () => {
cy.get(".nc-fields-menu-btn").should('exist').click(); cy.get(".nc-fields-menu-btn").should("exist").click();
cy.getActiveMenu(".nc-dropdown-fields-menu").find('.nc-fields-show-system-fields').click(); cy.getActiveMenu(".nc-dropdown-fields-menu")
cy.get(".nc-fields-menu-btn").should('exist').click(); .find(".nc-fields-show-system-fields")
} .click();
cy.get(".nc-fields-menu-btn").should("exist").click();
};
hideField = (field) => { hideField = (field) => {
cy.get(`th[data-title="${field}"]`).should("be.visible"); cy.get(`th[data-title="${field}"]`).should("be.visible");
cy.get(".nc-fields-menu-btn").click(); cy.get(".nc-fields-menu-btn").click();
cy.wait(500) // cy.getActiveMenu(".nc-dropdown-fields-menu")
cy.getActiveMenu(".nc-dropdown-fields-menu").find(`.nc-fields-list label:visible`).contains(new RegExp("^" + field + "$", "g")).click(); // .find(`.nc-fields-list label:contains(${field}):visible`)
cy.wait(500) // .click();
cy.getActiveMenu(".nc-dropdown-fields-menu")
.find(`.nc-fields-list label:visible`)
.contains(new RegExp("^" + field + "$", "g"))
.click();
cy.get(".nc-fields-menu-btn").click(); cy.get(".nc-fields-menu-btn").click();
cy.wait(500)
cy.get(`th[data-title="${field}"]`).should("not.exist"); cy.get(`th[data-title="${field}"]`).should("not.exist");
}; };
unhideField = (field, viewType = 'grid') => { unhideField = (field, viewType = "grid") => {
if(viewType === 'grid') { if (viewType === "grid") {
cy.get(`th[data-title="${field}"]`).should("not.exist"); cy.get(`th[data-title="${field}"]`).should("not.exist");
} }
cy.get(`th[data-title="${field}"]`).should("not.exist");
cy.get(".nc-fields-menu-btn").click(); cy.get(".nc-fields-menu-btn").click();
cy.wait(500) // cy.getActiveMenu(".nc-dropdown-fields-menu")
cy.getActiveMenu(".nc-dropdown-fields-menu").find(`.nc-fields-list label:visible`).contains(new RegExp("^" + field + "$", "g")).click(); // .find(`.nc-fields-list label:contains(${field}):visible`)
cy.wait(500) // .click();
cy.getActiveMenu(".nc-dropdown-fields-menu")
.find(`.nc-fields-list label:visible`)
.contains(new RegExp("^" + field + "$", "g"))
.click();
cy.get(".nc-fields-menu-btn").click(); cy.get(".nc-fields-menu-btn").click();
cy.wait(500) if (viewType === "grid") {
if(viewType === 'grid') {
cy.get(`th[data-title="${field}"]`).should("be.visible"); cy.get(`th[data-title="${field}"]`).should("be.visible");
} }
}; };
sortField = (field, criteria) => { sortField = (field, criteria) => {
cy.get(".nc-sort-menu-btn").click(); cy.get(".nc-sort-menu-btn").click();
cy.wait(500) cy.getActiveMenu(".nc-dropdown-sort-menu")
cy.getActiveMenu('.nc-dropdown-sort-menu').contains("Add Sort Option").click(); .find(".ant-btn-primary")
cy.wait(500) .contains("Add Sort Option")
// cy.get(".nc-sort-field-select div").first().click().type(field); .click();
cy.get(".nc-sort-field-select div").first().click(); cy.getActiveMenu(".nc-dropdown-sort-menu")
cy.wait(500) .find(".nc-sort-field-select div")
cy.get('.ant-select-dropdown:visible').find(`.ant-select-item`).contains(new RegExp("^" + field + "$", "g")).should('exist').click(); .first()
cy.wait(500) .click();
cy.get(".nc-sort-dir-select div").first().click(); cy.getActiveSelection(".nc-dropdown-toolbar-field-list")
cy.wait(500) .find(`.ant-select-item`)
cy.get('.sort-dir-dropdown.ant-select-dropdown:visible').find(`.ant-select-item`).contains(criteria).should('exist').click(); .contains(new RegExp("^" + field + "$", "g"))
cy.wait(500) .should("exist")
.click();
cy.getActiveMenu(".nc-dropdown-sort-menu")
.find(".nc-sort-dir-select div")
.first()
.click();
cy.getActiveSelection(".nc-dropdown-sort-dir")
.find(`.ant-select-item`)
.contains(criteria)
.should("exist")
.click();
cy.get(".nc-sort-menu-btn").click(); cy.get(".nc-sort-menu-btn").click();
cy.wait(500)
}; };
clearSort = () => { clearSort = () => {
cy.get(".nc-sort-menu-btn").click(); cy.get(".nc-sort-menu-btn").click();
cy.wait(500) cy.getActiveMenu(".nc-dropdown-sort-menu")
cy.get(".nc-sort-item-remove-btn").click(); .find(".nc-sort-item-remove-btn")
cy.wait(500) .click();
cy.get(".nc-sort-item-remove-btn:visible").should("not.exist"); cy.getActiveMenu(".nc-dropdown-sort-menu")
.find(".nc-sort-item-remove-btn:visible")
.should("not.exist");
cy.get(".nc-sort-menu-btn").click(); cy.get(".nc-sort-menu-btn").click();
cy.wait(500)
}; };
filterField = (field, operation, value) => { filterField = (field, operation, value) => {
cy.get(".nc-filter-menu-btn").click(); cy.get(".nc-filter-menu-btn").click();
cy.wait(500) cy.getActiveMenu(".nc-dropdown-filter-menu")
cy.contains("Add Filter").click(); .find(".ant-btn-primary")
cy.wait(500) .contains("Add Filter")
// cy.get(".nc-filter-field-select").should("exist").last().click().type(field); .click();
cy.get(".nc-filter-field-select").should("exist").last().click(); cy.getActiveMenu(".nc-dropdown-filter-menu")
cy.wait(500) .find(".nc-filter-field-select")
cy.get('.ant-select-dropdown:visible').should('exist').find(`.ant-select-item`).contains(new RegExp("^" + field + "$", "g")).should('exist').click();
cy.wait(500)
cy.get(".nc-filter-operation-select").should("exist").last().click();
cy.wait(500)
cy.get('.ant-select-dropdown:visible').should('exist').find(`.ant-select-item`).contains(operation).should('exist').click();
cy.wait(500)
if (operation != "is null" && operation != "is not null") {
cy.get(".nc-filter-value-select")
.should("exist") .should("exist")
.last() .last()
.type(value); .click();
cy.get(".nc-filter-operation-select").last().click(); cy.getActiveSelection(".nc-dropdown-toolbar-field-list")
cy.wait(500) .find(`.ant-select-item`)
.contains(new RegExp("^" + field + "$", "g"))
.should("exist")
.click();
cy.getActiveMenu(".nc-dropdown-filter-menu")
.find(".nc-filter-operation-select")
.should("exist")
.last()
.click();
cy.getActiveSelection(".nc-dropdown-filter-comp-op")
.find(`.ant-select-item`)
.contains(operation)
.should("exist")
.click();
if (operation != "is null" && operation != "is not null") {
cy.get(".nc-filter-value-select").should("exist").last().type(value);
} }
cy.get(".nc-filter-menu-btn").click(); cy.get(".nc-filter-menu-btn").click();
cy.wait(500)
}; };
filterReset = () => { filterReset = () => {
cy.get(".nc-filter-menu-btn").click(); cy.get(".nc-filter-menu-btn").click();
cy.wait(500) cy.getActiveMenu(".nc-dropdown-filter-menu")
cy.get(".nc-filter-item-remove-btn").click(); .find(".nc-filter-item-remove-btn")
cy.wait(500) .click();
cy.get(".nc-filter-item-remove-btn").should("not.exist"); cy.getActiveMenu(".nc-dropdown-filter-menu")
.find(".nc-filter-item-remove-btn")
.should("not.exist");
cy.get(".nc-filter-menu-btn").click(); cy.get(".nc-filter-menu-btn").click();
cy.wait(500)
}; };
// delete created views // delete created views
@ -420,7 +514,10 @@ export class _mainPage {
}) })
.then(() => { .then(() => {
cy.toastWait("Deleted shared view successfully"); cy.toastWait("Deleted shared view successfully");
cy.getActiveModal().find("button.ant-modal-close").should('exist').click(); cy.getActiveModal()
.find("button.ant-modal-close")
.should("exist")
.click();
}); });
}; };
@ -431,15 +528,23 @@ export class _mainPage {
// if it exists, verify it against 'expectedRecords' passed in as parameter // if it exists, verify it against 'expectedRecords' passed in as parameter
// //
downloadAndVerifyCsv = (filename, verifyCsv, role) => { downloadAndVerifyCsv = (filename, verifyCsv, role) => {
if (role === "commenter" || role === "viewer") {
if(role === 'commenter' || role === 'viewer') {
cy.get(".nc-actions-menu-btn").click(); cy.get(".nc-actions-menu-btn").click();
cy.getActiveMenu(".nc-dropdown-actions-menu").find('.nc-project-menu-item').contains('Download as CSV').click(); cy.getActiveMenu(".nc-dropdown-actions-menu")
.find(".nc-project-menu-item")
.contains("Download as CSV")
.click();
} else { } else {
cy.get(".nc-actions-menu-btn").click(); cy.get(".nc-actions-menu-btn").click();
cy.getActiveMenu(".nc-dropdown-actions-menu").find('.nc-project-menu-item').contains('Download').click(); cy.getActiveMenu(".nc-dropdown-actions-menu")
.find(".nc-project-menu-item")
.contains("Download")
.click();
cy.wait(1000); cy.wait(1000);
cy.get('.nc-project-menu-item').contains('Download as CSV').should('exist').click(); cy.get(".nc-project-menu-item")
.contains("Download as CSV")
.should("exist")
.click();
} }
cy.toastWait("Successfully exported all table data").then(() => { cy.toastWait("Successfully exported all table data").then(() => {
@ -459,7 +564,10 @@ export class _mainPage {
downloadAndVerifyCsvFromSharedView = (filename, verifyCsv) => { downloadAndVerifyCsvFromSharedView = (filename, verifyCsv) => {
cy.get(".nc-actions-menu-btn").click(); cy.get(".nc-actions-menu-btn").click();
cy.get('.nc-project-menu-item').contains('Download as CSV').should('exist').click(); cy.get(".nc-project-menu-item")
.contains("Download as CSV")
.should("exist")
.click();
cy.toastWait("Successfully exported all table data").then(() => { cy.toastWait("Successfully exported all table data").then(() => {
// download folder path, read from config file // download folder path, read from config file
@ -479,9 +587,7 @@ export class _mainPage {
getIFrameCell = (columnHeader, cellNumber) => { getIFrameCell = (columnHeader, cellNumber) => {
return cy return cy
.iframe() .iframe()
.find( .find(`tbody > :nth-child(${cellNumber}) > [data-col="${columnHeader}"]`);
`tbody > :nth-child(${cellNumber}) > [data-col="${columnHeader}"]`
);
}; };
// https://docs.cypress.io/guides/core-concepts/variables-and-aliases#Sharing-Context // https://docs.cypress.io/guides/core-concepts/variables-and-aliases#Sharing-Context
@ -499,19 +605,17 @@ export class _mainPage {
openMetaTab() { openMetaTab() {
// open Project metadata tab // open Project metadata tab
// //
settingsPage.openMenu(settingsPage.PROJ_METADATA) settingsPage.openMenu(settingsPage.PROJ_METADATA);
settingsPage.openTab(settingsPage.METADATA) settingsPage.openTab(settingsPage.METADATA);
} }
closeMetaTab() { closeMetaTab() {
// close Project metadata tab // close Project metadata tab
settingsPage.closeMenu() settingsPage.closeMenu();
} }
metaSyncValidate(tbl, msg) { metaSyncValidate(tbl, msg) {
cy.get(".nc-btn-metasync-reload") cy.get(".nc-btn-metasync-reload").should("exist").click();
.should("exist")
.click();
cy.wait(2000); cy.wait(2000);
cy.get(`.nc-metasync-row-${tbl}`).contains(msg).should("exist"); cy.get(`.nc-metasync-row-${tbl}`).contains(msg).should("exist");
cy.get(".nc-btn-metasync-sync-now") cy.get(".nc-btn-metasync-sync-now")

Loading…
Cancel
Save