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-row v-if="hook.notification.type === 'URL'" class="mb-5" type="flex" :gutter="[16, 0]">
<a-col :span="6"> <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-option v-for="(method, i) in methodList" :key="i" :value="method.title">{{ method.title }}</a-select-option>
</a-select> </a-select>
</a-col> </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" ] "Actor", "Status (from Actor)", "RollUp", "Computation", "Producer" ]
function openWebhook(index) { function openWebhook(index) {
cy.get(".nc-btn-webhook").should("exist").click(); cy.get('.nc-actions-menu-btn').should('exist').click();
cy.get(".nc-hook").eq(index).click({ force: true }); cy.getActiveMenu().find('.ant-dropdown-menu-title-content').contains('Webhooks').click()
cy.get(".nc-hook").eq(index).click();
} }
// to be invoked after open // to be invoked after open
function verifyWebhook(config) { function verifyWebhook(config) {
cy.get(".nc-text-field-hook-title") cy.get(".nc-text-field-hook-title").then(($element) => {
.find('input').then(($element) => {
expect($element[0].value).to.have.string(config.title) expect($element[0].value).to.have.string(config.title)
}) })
cy.get(".nc-text-field-hook-event") cy.get(".nc-text-field-hook-event")
.find('.v-select__selection') .find('.ant-select-selection-item')
.contains(config.event) .contains(config.event)
.should('exist') .should('exist')
cy.get(".nc-text-field-hook-notification-type") cy.get(".nc-select-hook-notification-type")
.find('.v-select__selection') .find('.ant-select-selection-item')
.contains(config.notification) .contains(config.notification)
.should('exist') .should('exist')
cy.get('.nc-select-hook-url-method') cy.get('.nc-select-hook-url-method')
.find('.v-select__selection') .find('.ant-select-selection-item')
.contains(config.type) .contains(config.type)
.should('exist') .should('exist')
cy.get(".nc-text-field-hook-url-path") cy.get(".nc-text-field-hook-url-path")
.find('input').then(($element) => { .then(($element) => {
expect($element[0].value).to.have.string(config.url) expect($element[0].value).to.have.string(config.url)
}) })
cy.get(".nc-icon-hook-navigate-left").click({force:true}) cy.get(".nc-icon-hook-navigate-left").click({force:true})

Loading…
Cancel
Save