Browse Source

test: webhook CY test

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/3384/head
Raju Udava 2 years ago
parent
commit
8444bff726
  1. 2
      packages/nc-gui-v2/components/webhook/Editor.vue
  2. 19
      scripts/cypress-v2/integration/common/9a_QuickTest.js

2
packages/nc-gui-v2/components/webhook/Editor.vue

@ -475,7 +475,7 @@ onMounted(async () => {
<a-row v-if="hook.notification.type === 'URL'" class="mb-5" type="flex" :gutter="[16, 0]">
<a-col :span="6">
<a-select v-model:value="hook.notification.payload.method" size="large">
<a-select v-model:value="hook.notification.payload.method" size="large" class="nc-select-hook-url-method">
<a-select-option v-for="(method, i) in methodList" :key="i" :value="method.title">{{ method.title }}</a-select-option>
</a-select>
</a-col>

19
scripts/cypress-v2/integration/common/9a_QuickTest.js

@ -39,30 +39,31 @@ let cn = [ "Name", "Notes", "Status", "Tags", "Done", "Date", "Phone",
"Actor", "Status (from Actor)", "RollUp", "Computation", "Producer" ]
function openWebhook(index) {
cy.get(".nc-btn-webhook").should("exist").click();
cy.get(".nc-hook").eq(index).click({ force: true });
cy.get('.nc-actions-menu-btn').should('exist').click();
cy.getActiveMenu().find('.ant-dropdown-menu-title-content').contains('Webhooks').click()
cy.get(".nc-hook").eq(index).click();
}
// to be invoked after open
function verifyWebhook(config) {
cy.get(".nc-text-field-hook-title")
.find('input').then(($element) => {
cy.get(".nc-text-field-hook-title").then(($element) => {
expect($element[0].value).to.have.string(config.title)
})
cy.get(".nc-text-field-hook-event")
.find('.v-select__selection')
.find('.ant-select-selection-item')
.contains(config.event)
.should('exist')
cy.get(".nc-text-field-hook-notification-type")
.find('.v-select__selection')
cy.get(".nc-select-hook-notification-type")
.find('.ant-select-selection-item')
.contains(config.notification)
.should('exist')
cy.get('.nc-select-hook-url-method')
.find('.v-select__selection')
.find('.ant-select-selection-item')
.contains(config.type)
.should('exist')
cy.get(".nc-text-field-hook-url-path")
.find('input').then(($element) => {
.then(($element) => {
expect($element[0].value).to.have.string(config.url)
})
cy.get(".nc-icon-hook-navigate-left").click({force:true})

Loading…
Cancel
Save