mirror of https://github.com/nocodb/nocodb
Pranav C
3 years ago
17 changed files with 142 additions and 237 deletions
@ -1,9 +1,10 @@ |
|||||||
{ |
{ |
||||||
"baseUrl": "http://localhost:3000", |
"baseUrl": "http://localhost:3000", |
||||||
"defaultCommandTimeout": 10000, |
"defaultCommandTimeout": 13000, |
||||||
"pageLoadTimeout": 600000, |
"pageLoadTimeout": 600000, |
||||||
"viewportWidth": 1600, |
"viewportWidth": 1980, |
||||||
"viewportHeight": 1000, |
"viewportHeight": 1000, |
||||||
"video": false, |
"video": false, |
||||||
"retries": 2 |
"retries": 2, |
||||||
|
"screenshotOnRunFailure": false |
||||||
} |
} |
||||||
|
@ -0,0 +1,102 @@ |
|||||||
|
const genTest = (type) => { |
||||||
|
|
||||||
|
describe(`${type.toUpperCase()} api - Rollup column`, () => { |
||||||
|
const colName = 'column_name' + Date.now(); |
||||||
|
const updatedColName = 'updated_name' + Date.now(); |
||||||
|
before(() => { |
||||||
|
cy.waitForSpinners(); |
||||||
|
if (type === 'rest') { |
||||||
|
cy.openOrCreateRestProject({ |
||||||
|
new:true |
||||||
|
}); |
||||||
|
} else { |
||||||
|
cy.openOrCreateGqlProject({ |
||||||
|
new:true |
||||||
|
}); |
||||||
|
} |
||||||
|
cy.openTableTab('Country'); |
||||||
|
}); |
||||||
|
|
||||||
|
it('Add rollup column', () => { |
||||||
|
|
||||||
|
cy.get('.v-window-item--active .nc-grid tr > th:last button').click({force: true}); |
||||||
|
|
||||||
|
cy.get('.nc-column-name-input input').clear().type(colName) |
||||||
|
|
||||||
|
cy.get('.nc-ui-dt-dropdown').click() |
||||||
|
cy.getActiveMenu().contains('Rollup').click() |
||||||
|
|
||||||
|
cy.get('.nc-rollup-table').click(); |
||||||
|
cy.getActiveMenu().contains('City').click(); |
||||||
|
cy.get('.nc-rollup-column').click(); |
||||||
|
cy.getActiveMenu().contains('CityId').click(); |
||||||
|
cy.get('.nc-rollup-fn').click(); |
||||||
|
cy.getActiveMenu().contains('count').click(); |
||||||
|
|
||||||
|
|
||||||
|
cy.get('.nc-col-create-or-edit-card').contains('Save').click() |
||||||
|
cy |
||||||
|
.get(`th:contains(${colName})`) |
||||||
|
.should('exist'); |
||||||
|
cy.wait(500) |
||||||
|
|
||||||
|
cy.get(`td[data-col="${colName}"]`).first().invoke('text').should('match', /^\s*\d+\s*$/) |
||||||
|
|
||||||
|
|
||||||
|
}) |
||||||
|
|
||||||
|
|
||||||
|
// edit the newly created column
|
||||||
|
it('Edit table column - rename', () => { |
||||||
|
|
||||||
|
|
||||||
|
cy.get(`th:contains(${colName}) .mdi-menu-down`) |
||||||
|
.trigger('mouseover', {force: true}) |
||||||
|
.click({force: true}) |
||||||
|
|
||||||
|
cy.get('.nc-column-edit').click() |
||||||
|
|
||||||
|
// rename column and verify
|
||||||
|
cy.get('.nc-column-name-input input').clear().type(updatedColName) |
||||||
|
cy.get('.nc-col-create-or-edit-card').contains('Save').click() |
||||||
|
|
||||||
|
|
||||||
|
cy |
||||||
|
.get(`th:contains(${updatedColName})`) |
||||||
|
.should('exist'); |
||||||
|
cy |
||||||
|
.get(`th:contains(${colName})`) |
||||||
|
.should('not.exist'); |
||||||
|
|
||||||
|
|
||||||
|
}) |
||||||
|
|
||||||
|
|
||||||
|
// delete the newly created column
|
||||||
|
it('Delete table column', () => { |
||||||
|
cy |
||||||
|
.get(`th:contains(${updatedColName})`) |
||||||
|
.should('exist'); |
||||||
|
|
||||||
|
cy.get(`th:contains(${updatedColName}) .mdi-menu-down`) |
||||||
|
.trigger('mouseover') |
||||||
|
.click() |
||||||
|
|
||||||
|
cy.get('.nc-column-delete').click() |
||||||
|
cy.getActiveModal().find('button:contains(Confirm)').click() |
||||||
|
|
||||||
|
|
||||||
|
cy |
||||||
|
.get(`th:contains(${updatedColName})`) |
||||||
|
.should('not.exist'); |
||||||
|
|
||||||
|
}) |
||||||
|
|
||||||
|
|
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
genTest('rest') |
||||||
|
genTest('graphql') |
||||||
|
|
@ -1,5 +0,0 @@ |
|||||||
{ |
|
||||||
"name": "Using fixtures to represent data", |
|
||||||
"email": "hello@cypress.io", |
|
||||||
"body": "Fixtures are a great way to mock data for responses to routes" |
|
||||||
} |
|
@ -1,36 +0,0 @@ |
|||||||
/* eslint-disable */ |
|
||||||
describe('My First Test', () => { |
|
||||||
it('Does not do much!', () => { |
|
||||||
describe('My First Test', () => { |
|
||||||
it('Sign Up / Sign In', () => { |
|
||||||
cy.visit('http://localhost:3000') |
|
||||||
cy.get('body').then(($body) => { |
|
||||||
if ($body.find('.let-us-begin').length > 0) { |
|
||||||
cy.contains('Let\'s Begin').click() |
|
||||||
cy.wait(1000) |
|
||||||
cy.get('input[type="text"]').type('pranavc@gmail.com') |
|
||||||
cy.get('input[type="password"]').type('Password123.') |
|
||||||
cy.contains('Sign Up').click() |
|
||||||
} else { |
|
||||||
cy.get('input[type="text"]').type('pranavc@gmail.com') |
|
||||||
cy.get('input[type="password"]').type('Password123.') |
|
||||||
cy.contains('Sign In').click() |
|
||||||
} |
|
||||||
}) |
|
||||||
}) |
|
||||||
|
|
||||||
it('Create Project', () => { |
|
||||||
cy.wait(1000) |
|
||||||
cy.contains('New Project').trigger('onmouseover').trigger('mouseenter') |
|
||||||
cy.wait(1500) |
|
||||||
cy.get('.create-external-db-project').click() |
|
||||||
cy.wait(5500) |
|
||||||
cy.get('.database-field input').click().clear().type('sakila') |
|
||||||
cy.contains('Test Database Connection').click() |
|
||||||
|
|
||||||
cy.wait(1500) |
|
||||||
cy.contains('Ok & Save Project').click() |
|
||||||
}) |
|
||||||
}) |
|
||||||
}) |
|
||||||
}) |
|
@ -1,22 +0,0 @@ |
|||||||
/// <reference types="cypress" />
|
|
||||||
// ***********************************************************
|
|
||||||
// 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)
|
|
||||||
|
|
||||||
/** |
|
||||||
* @type {Cypress.PluginConfig} |
|
||||||
*/ |
|
||||||
// eslint-disable-next-line no-unused-vars
|
|
||||||
module.exports = (on, config) => { |
|
||||||
// `on` is used to hook into various events Cypress emits
|
|
||||||
// `config` is the resolved Cypress config
|
|
||||||
} |
|
@ -1,25 +0,0 @@ |
|||||||
// ***********************************************
|
|
||||||
// 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 will overwrite an existing command --
|
|
||||||
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
|
|
@ -1,20 +0,0 @@ |
|||||||
// ***********************************************************
|
|
||||||
// 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 commands.js using ES2015 syntax:
|
|
||||||
import './commands' |
|
||||||
|
|
||||||
// Alternatively you can use CommonJS syntax:
|
|
||||||
// require('./commands')
|
|
Loading…
Reference in new issue