chore: Cypress test case for create label flow

This commit is contained in:
Sanju 2021-07-23 16:38:44 +05:30 committed by GitHub
parent d955d8e7dc
commit 7e0937f3ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 33 additions and 6 deletions

View file

@ -30,6 +30,7 @@
color-scheme="success"
icon="ion-android-add-circle"
@click="onToggleCreate"
data-testid="create-new-contact"
>
{{ $t('CREATE_CONTACT.BUTTON_LABEL') }}
</woot-button>

View file

@ -12,6 +12,7 @@
:label="$t('LABEL_MGMT.FORM.NAME.LABEL')"
:placeholder="$t('LABEL_MGMT.FORM.NAME.PLACEHOLDER')"
:error="getLabelTitleErrorMessage"
data-testid="label-title"
@input="$v.title.$touch"
/>
@ -21,6 +22,7 @@
class="medium-12 columns"
:label="$t('LABEL_MGMT.FORM.DESCRIPTION.LABEL')"
:placeholder="$t('LABEL_MGMT.FORM.DESCRIPTION.PLACEHOLDER')"
data-testid="label-description"
@input="$v.description.$touch"
/>
@ -41,6 +43,7 @@
<woot-button
:is-disabled="$v.title.$invalid || uiFlags.isCreating"
:is-loading="uiFlags.isCreating"
data-testid="label-submit"
>
{{ $t('LABEL_MGMT.FORM.CREATE') }}
</woot-button>

View file

@ -1,4 +1,6 @@
{
"baseUrl": "http://localhost:5050",
"defaultCommandTimeout": 10000
"defaultCommandTimeout": 10000,
"viewportWidth": 1250,
"viewportHeight": 800
}

View file

@ -1,7 +1,7 @@
describe('AdminDashboardAuthentication', function () {
before(() => {
cy.app('clean');
cy.appScenario('default')
cy.appScenario('default');
});
it('authenticates an admin ', function () {
@ -12,9 +12,9 @@ describe('AdminDashboardAuthentication', function() {
.type('john@acme.inc');
cy.get("[data-testid='password_input']")
.clear()
.type('123456');
.type('Password1!');
cy.get("[data-testid='submit_button']").click();
cy.contains('Conversations');
});
});

View file

@ -0,0 +1,21 @@
describe('AdminCreateLabel', () => {
before(() => {
cy.wait(3000);
});
it('open add label modal', () => {
cy.get(
'ul.menu.vertical > li:last-child > a.sub-menu-title.side-menu > span.child-icon.ion-android-add-circle'
).click();
});
it('create a label', () => {
cy.get("[data-testid='label-title'] > input")
.clear()
.type(`show_stopper_${new Date().getTime()}`);
cy.get("[data-testid='label-description'] > input")
.clear()
.type('denote it with show show stopper cases');
cy.get("[data-testid='label-submit']").click();
});
});