refactor: replace custom CRM with Monica fork
Some checks failed
Build & Push Monica Image to Gitea Registry / build-and-push (push) Failing after 9s
Some checks failed
Build & Push Monica Image to Gitea Registry / build-and-push (push) Failing after 9s
This commit is contained in:
35
tests/cypress/integration/contacts/activities_spec.js
vendored
Normal file
35
tests/cypress/integration/contacts/activities_spec.js
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
describe('Activities', function () {
|
||||
beforeEach(function () {
|
||||
cy.login();
|
||||
cy.createContact('John', 'Doe', 'Man');
|
||||
});
|
||||
|
||||
it('lets you manage an activity', function () {
|
||||
cy.url().should('include', '/people/h:');
|
||||
cy.get('[cy-name=activities-blank-state]').should('be.visible');
|
||||
|
||||
// add an activity
|
||||
cy.createActivity();
|
||||
|
||||
// edit an activity
|
||||
cy.get('[cy-name=activities-body]').should('be.visible')
|
||||
.invoke('attr', 'cy-items').then(function (item) {
|
||||
|
||||
cy.get('[cy-name=edit-activity-button-'+item+']').click();
|
||||
|
||||
cy.get('[name=summary]').clear();
|
||||
cy.get('[name=summary]').type('This is another summary');
|
||||
cy.get('[cy-name=save-activity-button]').click();
|
||||
|
||||
cy.get('[cy-name=activity-body-'+item+']').should('exist');
|
||||
cy.get('[cy-name=activity-body-'+item+']').should('contain', 'This is another summary');
|
||||
|
||||
// delete an activity
|
||||
cy.get('[cy-name=delete-activity-button-'+item+']').click();
|
||||
cy.wait(10);
|
||||
cy.get('[cy-name=confirm-delete-activity]').should('be.visible').click();
|
||||
cy.get('[cy-name=activities-blank-state]').should('be.visible');
|
||||
cy.get('[cy-name=activity-body-'+item+']').should('not.exist');
|
||||
});
|
||||
});
|
||||
});
|
||||
38
tests/cypress/integration/contacts/calls_spec.js
vendored
Normal file
38
tests/cypress/integration/contacts/calls_spec.js
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
var _ = require('lodash');
|
||||
|
||||
describe('Calls', function () {
|
||||
beforeEach(function () {
|
||||
cy.login();
|
||||
cy.createContact('John', 'Doe', 'Man');
|
||||
});
|
||||
|
||||
it('lets you manage a call', function () {
|
||||
cy.url().should('include', '/people/h:');
|
||||
cy.get('[cy-name=calls-blank-state]').should('exist');
|
||||
cy.get('[cy-name=log-call-form]').should('not.be.visible');
|
||||
cy.get('[cy-name=last-talked-to]').should('contain', 'unknown');
|
||||
|
||||
// add a call
|
||||
cy.get('[cy-name=add-call-button]').click();
|
||||
cy.get('[cy-name=log-call-form]').should('be.visible');
|
||||
cy.get('[cy-name=save-call-button]').click();
|
||||
cy.get('[cy-name=calls-blank-state]').should('not.exist');
|
||||
cy.get('[cy-name=last-talked-to]').should('not.contain', 'unknown');
|
||||
|
||||
cy.get('[cy-name=calls-body]').should('be.visible')
|
||||
.invoke('attr', 'cy-items').then(function (items) {
|
||||
let item = _.last(items.split(','));
|
||||
|
||||
cy.get('[cy-name=call-body-'+item+']').should('exist');
|
||||
cy.get('[cy-name=call-body-'+item+']').should('contain', 'John');
|
||||
|
||||
// delete a call
|
||||
cy.get('[cy-name=delete-call-button-'+item+']').should('be.visible');
|
||||
cy.get('[cy-name=delete-call-button-'+item+']').click();
|
||||
cy.get('[cy-name=delete-call-confirm-button-'+item+']').should('be.visible');
|
||||
cy.get('[cy-name=delete-call-confirm-button-'+item+']').click();
|
||||
cy.get('[cy-name=calls-blank-state]').should('exist');
|
||||
cy.get('[cy-name=last-talked-to]').should('contain', 'unknown');
|
||||
});
|
||||
});
|
||||
});
|
||||
95
tests/cypress/integration/contacts/contacts_spec.js
vendored
Normal file
95
tests/cypress/integration/contacts/contacts_spec.js
vendored
Normal file
@@ -0,0 +1,95 @@
|
||||
describe('Contacts', function () {
|
||||
beforeEach(function () {
|
||||
cy.login();
|
||||
});
|
||||
|
||||
it('lets you add a contact', function () {
|
||||
cy.createContact('John', 'Doe', 'Man');
|
||||
cy.url().should('include', '/people/h:');
|
||||
cy.get('h1').should('contain', 'John Doe');
|
||||
});
|
||||
|
||||
it('lets you add two contacts in a row', function () {
|
||||
cy.createContact('John', 'Doe', 'Man', 'save_and_add_another');
|
||||
cy.url().should('include', '/people/add');
|
||||
});
|
||||
|
||||
it('requires at least a firstname to add a contact', function () {
|
||||
cy.visit('/people');
|
||||
cy.get('#button-add-contact').click();
|
||||
cy.get('button[name=save]').click();
|
||||
cy.url().should('include', '/people/add');
|
||||
|
||||
cy.get('input[name=first_name]').type('John');
|
||||
cy.get('select[name=gender]').select('Man');
|
||||
cy.get('button[name=save]').click();
|
||||
|
||||
cy.url().should('include', '/people/h:');
|
||||
cy.get('h1').should('contain', 'John');
|
||||
});
|
||||
|
||||
it('lets you edit a contact', function () {
|
||||
cy.createContact('John', 'Doe', 'Man');
|
||||
|
||||
cy.get('#button-edit-contact').click();
|
||||
cy.url().should('include', '/edit');
|
||||
|
||||
cy.get('input[name=firstname]').should('have.value', 'John');
|
||||
cy.get('input[name=lastname]').should('have.value', 'Doe');
|
||||
//TO FIX cy.get('select[name=gender]').should('have.text', 'Man')
|
||||
|
||||
cy.get('input[name=firstname]').clear();
|
||||
cy.get('input[name=firstname]').type('Jane');
|
||||
cy.get('input[name=lastname]').clear();
|
||||
cy.get('button[name=save]').click();
|
||||
|
||||
cy.url().should('include', '/people/h:');
|
||||
cy.get('h1').should('contain', 'Jane');
|
||||
});
|
||||
|
||||
it('lets you delete a contact', function () {
|
||||
cy.createContact('John', 'Doe', 'Man');
|
||||
|
||||
cy.visit('/people');
|
||||
cy.get('.people-list-item').should('contain', 'John Doe');
|
||||
|
||||
// this gets the first content of the list
|
||||
cy.get('tr.people-list-item.bg-white.pointer').click();
|
||||
|
||||
cy.get('#link-delete-contact').click();
|
||||
|
||||
// cypress auto accepts window alerts (confirm or alert)
|
||||
cy.url().should('include', '/people');
|
||||
|
||||
cy.visit('/people');
|
||||
cy.get('.people-list-item').should('not.contain', 'John');
|
||||
});
|
||||
|
||||
it('lets you add a contact as favorite', function () {
|
||||
cy.createContact('John', 'Doe', 'Man');
|
||||
|
||||
cy.visit('/people');
|
||||
|
||||
// this gets the first content of the list
|
||||
cy.get('tr.people-list-item.bg-white.pointer').click();
|
||||
|
||||
// tests if the favorite button can be toggled
|
||||
cy.get('[cy-name=set-favorite]').should('be.visible');
|
||||
cy.get('[cy-name=set-favorite]').click();
|
||||
cy.get('[cy-name=set-favorite]').should('not.be.visible');
|
||||
cy.get('[cy-name=unset-favorite]').should('be.visible');
|
||||
cy.get('[cy-name=unset-favorite]').click();
|
||||
cy.get('[cy-name=set-favorite]').should('be.visible');
|
||||
|
||||
// test to see if a contact appears on top of the contact list if favorited
|
||||
cy.get('[cy-name=set-favorite]').click();
|
||||
cy.visit('/dashboard');
|
||||
cy.createContact('Abc', 'Abc', 'Man');
|
||||
cy.visit('/people');
|
||||
|
||||
cy.get('.people-list-item span').should('contain', 'John Doe');
|
||||
cy.get('.people-list-item svg').should('be.visible');
|
||||
|
||||
cy.get('.people-list-item').should('contain', 'Abc Abc');
|
||||
});
|
||||
});
|
||||
27
tests/cypress/integration/contacts/conversations_spec.js
vendored
Normal file
27
tests/cypress/integration/contacts/conversations_spec.js
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
describe('Conversations', function () {
|
||||
beforeEach(function () {
|
||||
cy.login();
|
||||
cy.createContact('John', 'Doe', 'Man');
|
||||
});
|
||||
|
||||
it('lets you manage a conversation', function () {
|
||||
cy.get('[cy-name=conversation-blank-state]').should('be.visible');
|
||||
|
||||
// add a conversation
|
||||
cy.visit('/people');
|
||||
|
||||
// this gets the first content of the list
|
||||
cy.get('tr.people-list-item.bg-white.pointer').click();
|
||||
|
||||
cy.get('[cy-name=add-conversation-button]').should('be.visible');
|
||||
cy.get('[cy-name=add-conversation-button]').click();
|
||||
cy.url().should('include', '/conversations/create');
|
||||
|
||||
cy.get('[name=contactFieldTypeId]').select('Phone');
|
||||
cy.get('[name=content_1]').type('This is a message');
|
||||
cy.get('[cy-name=save-conversation-button]').click();
|
||||
|
||||
cy.url().should('include', '/people/h:');
|
||||
cy.get('[cy-name=conversation-blank-state]').should('not.be.visible');
|
||||
});
|
||||
});
|
||||
46
tests/cypress/integration/contacts/debts_spec.js
vendored
Normal file
46
tests/cypress/integration/contacts/debts_spec.js
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
describe('Debts', function () {
|
||||
beforeEach(function () {
|
||||
cy.login();
|
||||
cy.createContact('John', 'Doe', 'Man');
|
||||
});
|
||||
|
||||
it('lets you manage a debt', function () {
|
||||
cy.url().should('include', '/people/h:');
|
||||
cy.get('[cy-name=debt-blank-state]').should('be.visible');
|
||||
|
||||
// add a debt
|
||||
cy.get('[cy-name=add-debt-button]').should('be.visible');
|
||||
cy.get('[cy-name=add-debt-button]').click();
|
||||
cy.url().should('include', '/debts/create');
|
||||
|
||||
cy.get('[name=amount]').type('123');
|
||||
cy.get('[cy-name=save-debt-button]').click();
|
||||
|
||||
cy.url().should('include', '/people/h:');
|
||||
cy.get('[cy-name=debt-blank-state]').should('not.be.visible');
|
||||
|
||||
cy.get('[cy-name=debts-body]').should('be.visible')
|
||||
.invoke('attr', 'cy-items').then(function (item) {
|
||||
|
||||
cy.get('[cy-name=debt-item-'+item+']').should('exist');
|
||||
cy.get('[cy-name=debt-item-'+item+']').should('contain', '123');
|
||||
|
||||
// edit a debt
|
||||
cy.get('[cy-name=edit-debt-button-'+item+']').click();
|
||||
cy.url().should('include', '/edit');
|
||||
|
||||
cy.get('[name=amount]').clear();
|
||||
cy.get('[name=amount]').type('234');
|
||||
cy.get('[cy-name=save-debt-button]').click();
|
||||
|
||||
cy.get('[cy-name=debt-item-'+item+']').should('exist');
|
||||
cy.get('[cy-name=debt-item-'+item+']').should('contain', '234');
|
||||
|
||||
// delete a debt
|
||||
cy.get('[cy-name=delete-debt-button-'+item+']').click();
|
||||
cy.get('[cy-name=confirm-delete-debt]').should('be.visible').click();
|
||||
cy.get('[cy-name=debt-blank-state]').should('be.visible');
|
||||
cy.get('[cy-name=debt-item-'+item+']').should('not.exist');
|
||||
});
|
||||
});
|
||||
});
|
||||
50
tests/cypress/integration/contacts/gifts_spec.js
vendored
Normal file
50
tests/cypress/integration/contacts/gifts_spec.js
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
|
||||
Gift page has change recently a lot, let rewrite this test later ...
|
||||
|
||||
###
|
||||
describe('Gifts', function () {
|
||||
beforeEach(function () {
|
||||
cy.login();
|
||||
cy.createContact('John', 'Doe', 'Man');
|
||||
});
|
||||
|
||||
it('lets you manage a gift', function () {
|
||||
cy.url().should('include', '/people/h:');
|
||||
|
||||
// add a gift
|
||||
cy.get('[cy-name=add-gift-button]').should('be.visible');
|
||||
cy.get('[cy-name=add-gift-button]').click();
|
||||
cy.url().should('include', '/gifts/create');
|
||||
|
||||
cy.get('[name=name]').type('This is a gift');
|
||||
cy.get('[cy-name=save-gift-button]').click();
|
||||
|
||||
cy.url().should('include', '/people/h:');
|
||||
|
||||
cy.get('[cy-name=gift-ideas-body]').should('be.visible')
|
||||
.invoke('attr', 'cy-items').then(function (item) {
|
||||
|
||||
cy.get('[cy-name=gift-idea-item-'+item+']').should('exist');
|
||||
cy.get('[cy-name=gift-idea-item-'+item+']').should('contain', 'This is a gift');
|
||||
|
||||
// edit a gift
|
||||
cy.get('[cy-name=edit-gift-button-'+item+']').click();
|
||||
cy.url().should('include', '/gifts/'+item+'/edit');
|
||||
|
||||
cy.get('[name=name]').clear();
|
||||
cy.get('[name=name]').type('This is another gift');
|
||||
cy.get('[cy-name=save-gift-button]').click();
|
||||
|
||||
cy.get('[cy-name=gift-idea-item-'+item+']').should('exist');
|
||||
cy.get('[cy-name=gift-idea-item-'+item+']').should('contain', 'This is another gift');
|
||||
|
||||
// delete an gift
|
||||
cy.get('[cy-name=delete-gift-button-'+item+']').click();
|
||||
cy.get('[cy-name=modal-delete-gift-button-'+item+']').click();
|
||||
cy.get('[cy-name=activities-blank-state]').should('be.visible');
|
||||
cy.get('[cy-name=gift-idea-item-'+item+']').should('not.exist');
|
||||
});
|
||||
});
|
||||
});
|
||||
*/
|
||||
65
tests/cypress/integration/contacts/introductions_spec.js
vendored
Normal file
65
tests/cypress/integration/contacts/introductions_spec.js
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
describe('Introduction', function () {
|
||||
beforeEach(function () {
|
||||
cy.login();
|
||||
cy.createContact('John', 'Doe', 'Man');
|
||||
cy.createContact('Jane', 'Doe', 'Woman');
|
||||
cy.createContact('Joe', 'Shmoe', 'Man');
|
||||
});
|
||||
|
||||
it('lets you fill first met without an introducer', function () {
|
||||
cy.url().should('include', '/people/h:');
|
||||
|
||||
cy.get('.introductions a[href$="introductions/edit"]').click();
|
||||
cy.url().should('include', '/introductions/edit');
|
||||
|
||||
cy.get('textarea[name=first_met_additional_info]').type('Lorem ipsum');
|
||||
cy.get('button.btn-primary[type=submit]').click();
|
||||
|
||||
cy.url().should('include', '/people/h:');
|
||||
cy.get('.alert-success');
|
||||
cy.get('.introductions').contains('Lorem ipsum');
|
||||
});
|
||||
|
||||
it('lets you save first met', function () {
|
||||
cy.url().should('include', '/people/h:');
|
||||
|
||||
cy.get('.introductions a[href$="introductions/edit"]').click();
|
||||
cy.url().should('include', '/introductions/edit');
|
||||
|
||||
cy.get('textarea[name=first_met_additional_info]').type('Lorem ipsum');
|
||||
cy.get('#metThrough > .v-select input').click();
|
||||
cy.get('#metThrough ul[role="listbox"]').contains('John Doe');
|
||||
cy.get('#metThrough ul[role="listbox"]').contains('Jane Doe');
|
||||
cy.get('#metThrough ul[role="listbox"]').contains('Joe Shmoe');
|
||||
|
||||
cy.get('#metThrough ul[role="listbox"]').contains('John Doe').click();
|
||||
|
||||
cy.get('button.btn-primary[type=submit]').click();
|
||||
|
||||
cy.url().should('include', '/people/h:');
|
||||
cy.get('.alert-success');
|
||||
cy.get('.introductions').contains('Lorem ipsum');
|
||||
cy.get('.introductions').contains('John Doe');
|
||||
});
|
||||
|
||||
it('lets you search first met', function () {
|
||||
cy.url().should('include', '/people/h:');
|
||||
|
||||
cy.get('.introductions a[href$="introductions/edit"]').click();
|
||||
cy.url().should('include', '/introductions/edit');
|
||||
|
||||
cy.get('textarea[name=first_met_additional_info]').type('Lorem ipsum');
|
||||
cy.get('#metThrough input[type=search]').type('John');
|
||||
cy.get('#metThrough ul[role="listbox"]').contains('John Doe');
|
||||
cy.get('#metThrough ul[role="listbox"]').should('not.contain', 'Joe Shmoe');
|
||||
cy.get('#metThrough ul[role="listbox"]').should('not.contain', 'Jane Doe');
|
||||
|
||||
cy.get('#metThrough ul[role="listbox"]').contains('John Doe').click();
|
||||
cy.get('button.btn-primary[type=submit]').click();
|
||||
|
||||
cy.url().should('include', '/people/h:');
|
||||
cy.get('.introductions').contains('Lorem ipsum');
|
||||
cy.get('.introductions').contains('John Doe');
|
||||
});
|
||||
|
||||
});
|
||||
45
tests/cypress/integration/contacts/notes_spec.js
vendored
Normal file
45
tests/cypress/integration/contacts/notes_spec.js
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
describe('Notes', function () {
|
||||
beforeEach(function () {
|
||||
cy.login();
|
||||
cy.createContact('John', 'Doe', 'Man');
|
||||
});
|
||||
|
||||
it('lets you manage a note', function () {
|
||||
cy.url().should('include', '/people/h:');
|
||||
cy.get('[cy-name=add-note-button]').should('not.be.visible');
|
||||
|
||||
// add a note
|
||||
cy.get('[cy-name=add-note-textarea]').click();
|
||||
cy.get('[cy-name=add-note-button]').should('be.visible');
|
||||
|
||||
cy.get('[cy-name=add-note-textarea]').type('This is a note');
|
||||
cy.get('[cy-name=add-note-button]').click();
|
||||
|
||||
cy.get('[cy-name=notes-body]').should('be.visible')
|
||||
.invoke('attr', 'cy-items').then(function (item) {
|
||||
|
||||
cy.get('[cy-name=note-body-'+item+']').should('contain', 'This is a note');
|
||||
|
||||
cy.get('[cy-name=edit-note-body-'+item+']').should('not.be.visible');
|
||||
|
||||
// edit a note
|
||||
cy.get('[cy-name=edit-note-button-'+item+']').click();
|
||||
cy.get('[cy-name=edit-note-body-'+item+']').should('be.visible');
|
||||
|
||||
cy.get('[cy-name=edit-note-body-'+item+']').clear();
|
||||
cy.get('[cy-name=edit-note-body-'+item+']').type('This is another note');
|
||||
cy.get('[cy-name=edit-mode-note-button-'+item+']').click();
|
||||
|
||||
cy.get('[cy-name=edit-note-body-'+item+']').should('not.be.visible');
|
||||
cy.get('[cy-name=note-body-'+item+']').should('contain', 'This is another note');
|
||||
|
||||
// delete a note
|
||||
cy.get('[cy-name=modal-delete-note]').should('not.be.visible');
|
||||
cy.get('[cy-name=delete-note-button-'+item+']').click();
|
||||
cy.get('[cy-name=modal-delete-note]').should('be.visible');
|
||||
cy.get('[cy-name=delete-mode-note-button-'+item+']').click();
|
||||
|
||||
cy.get('[cy-name=note-body-'+item+']').should('not.exist');
|
||||
});
|
||||
});
|
||||
});
|
||||
31
tests/cypress/integration/contacts/tasks_spec.js
vendored
Normal file
31
tests/cypress/integration/contacts/tasks_spec.js
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
describe('Tasks', function () {
|
||||
beforeEach(function () {
|
||||
cy.login();
|
||||
cy.createContact('John', 'Doe', 'Man');
|
||||
});
|
||||
|
||||
it('lets you manage a task', function () {
|
||||
cy.url().should('include', '/people/h:');
|
||||
cy.get('[cy-name=task-blank-state]').should('be.visible');
|
||||
|
||||
// add a task
|
||||
cy.get('[cy-name=add-task-button]').click();
|
||||
cy.get('[cy-name=task-add-view]').should('be.visible');
|
||||
|
||||
cy.get('[cy-name=task-add-title]').type('This is a task');
|
||||
cy.get('[cy-name=save-task-button]').click();
|
||||
|
||||
cy.get('[cy-name=tasks-body]').should('be.visible')
|
||||
.invoke('attr', 'cy-items').then(function (item) {
|
||||
|
||||
cy.get('[cy-name=task-item-'+item+']').should('exist');
|
||||
cy.get('[cy-name=task-item-'+item+']').should('contain', 'This is a task');
|
||||
|
||||
// edit a task
|
||||
cy.get('[cy-name=task-toggle-edit-mode]').click();
|
||||
cy.get('[cy-name=task-delete-button-'+item+']').click();
|
||||
|
||||
cy.get('[cy-name=task-blank-state]').should('be.visible');
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user