deepeshgarg007
6 years ago
10 changed files with 1418 additions and 24 deletions
@ -0,0 +1,3 @@ |
|||
{ |
|||
"baseUrl": "http://test_site_ui:8000" |
|||
} |
@ -0,0 +1,5 @@ |
|||
{ |
|||
"name": "Using fixtures to represent data", |
|||
"email": "hello@cypress.io", |
|||
"body": "Fixtures are a great way to mock data for responses to routes" |
|||
} |
@ -0,0 +1,32 @@ |
|||
context('Form', () => { |
|||
before(() => { |
|||
cy.login('Administrator', 'qwe'); |
|||
cy.visit('/desk'); |
|||
}); |
|||
|
|||
it('create a new opportunity', () => { |
|||
cy.visit('/desk#Form/Opportunity/New Opportunity 1'); |
|||
cy.get('.page-title').should('contain', 'Not Saved'); |
|||
cy.fill_field('enquiry_from', 'Customer', 'Select'); |
|||
cy.fill_field('customer', 'Test Customer', 'Link').blur(); |
|||
cy.get('.primary-action').click(); |
|||
cy.get('.page-title').should('contain', 'Open'); |
|||
cy.get('.form-inner-toolbar button:contains("Lost")').click({ force: true }); |
|||
cy.get('.modal input[data-fieldname="lost_reason"]').as('input') |
|||
cy.get('@input').focus().type('Higher', { delay: 200 }) |
|||
cy.get('.modal .awesomplete ul') |
|||
.should('be.visible') |
|||
.get('li:contains("Higher Price")') |
|||
.click({ force: true }) |
|||
cy.get('@input').focus().type('No Followup', { delay: 200 }) |
|||
cy.get('.modal .awesomplete ul') |
|||
.should('be.visible') |
|||
.get('li:contains("No Followup")') |
|||
.click() |
|||
|
|||
cy.fill_field('detailed_reason', 'Test Detailed Reason', 'Text'); |
|||
cy.get('.modal button:contains("Declare Lost")').click({ force: true }); |
|||
cy.get('.page-title').should('contain', 'Lost'); |
|||
}); |
|||
}); |
|||
|
@ -0,0 +1,17 @@ |
|||
// ***********************************************************
|
|||
// This example plugins/index.js can be used to load plugins
|
|||
//
|
|||
// You can change the location of this file or turn off loading
|
|||
// the plugins file with the 'pluginsFile' configuration option.
|
|||
//
|
|||
// You can read more here:
|
|||
// https://on.cypress.io/plugins-guide
|
|||
// ***********************************************************
|
|||
|
|||
// This function is called when a project is opened or re-opened (e.g. due to
|
|||
// the project's config changing)
|
|||
|
|||
module.exports = (on, config) => { |
|||
// `on` is used to hook into various events Cypress emits
|
|||
// `config` is the resolved Cypress config
|
|||
} |
@ -0,0 +1,25 @@ |
|||
// ***********************************************
|
|||
// This example commands.js shows you how to
|
|||
// create various custom commands and overwrite
|
|||
// existing commands.
|
|||
//
|
|||
// For more comprehensive examples of custom
|
|||
// commands please read more here:
|
|||
// https://on.cypress.io/custom-commands
|
|||
// ***********************************************
|
|||
//
|
|||
//
|
|||
// -- This is a parent command --
|
|||
// Cypress.Commands.add("login", (email, password) => { ... })
|
|||
//
|
|||
//
|
|||
// -- This is a child command --
|
|||
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
|
|||
//
|
|||
//
|
|||
// -- This is a dual command --
|
|||
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
|
|||
//
|
|||
//
|
|||
// -- This is will overwrite an existing command --
|
|||
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
|
@ -0,0 +1,22 @@ |
|||
// ***********************************************************
|
|||
// This example support/index.js is processed and
|
|||
// loaded automatically before your test files.
|
|||
//
|
|||
// This is a great place to put global configuration and
|
|||
// behavior that modifies Cypress.
|
|||
//
|
|||
// You can change the location of this file or turn off
|
|||
// automatically serving support files with the
|
|||
// 'supportFile' configuration option.
|
|||
//
|
|||
// You can read more here:
|
|||
// https://on.cypress.io/configuration
|
|||
// ***********************************************************
|
|||
|
|||
// import frappe commands
|
|||
import '../../../frappe/cypress/support/index' |
|||
// Import commands.js using ES2015 syntax:
|
|||
import './commands' |
|||
|
|||
// Alternatively you can use CommonJS syntax:
|
|||
// require('./commands')
|
@ -0,0 +1,5 @@ |
|||
{ |
|||
"dependencies": { |
|||
"cypress": "^3.1.4" |
|||
} |
|||
} |
File diff suppressed because it is too large
Loading…
Reference in new issue