fix linting errors
This commit is contained in:
parent
5d84ceb7f6
commit
7a65da7899
|
@ -5,6 +5,7 @@
|
||||||
"@rollup/plugin-json": "^4.0.2",
|
"@rollup/plugin-json": "^4.0.2",
|
||||||
"babel-eslint": "^10.0.3",
|
"babel-eslint": "^10.0.3",
|
||||||
"eslint": "^6.8.0",
|
"eslint": "^6.8.0",
|
||||||
|
"eslint-plugin-cypress": "^2.11.1",
|
||||||
"eslint-plugin-prettier": "^3.1.2",
|
"eslint-plugin-prettier": "^3.1.2",
|
||||||
"eslint-plugin-svelte3": "^2.7.3",
|
"eslint-plugin-svelte3": "^2.7.3",
|
||||||
"lerna": "3.14.1",
|
"lerna": "3.14.1",
|
||||||
|
|
|
@ -1,21 +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}
|
|
||||||
*/
|
|
||||||
module.exports = (on, config) => {
|
|
||||||
// `on` is used to hook into various events Cypress emits
|
|
||||||
// `config` is the resolved Cypress config
|
|
||||||
}
|
|
|
@ -3,8 +3,8 @@
|
||||||
// 2. Initialises using `.budibase-cypress`
|
// 2. Initialises using `.budibase-cypress`
|
||||||
// 3. Runs the server using said folder
|
// 3. Runs the server using said folder
|
||||||
|
|
||||||
const rimraf = require("rimraf");
|
const rimraf = require("rimraf")
|
||||||
const homedir = require('os').homedir() + '/.budibase-cypress';
|
const homedir = require("os").homedir() + "/.budibase-cypress"
|
||||||
const { execSync } = require("child_process")
|
const { execSync } = require("child_process")
|
||||||
|
|
||||||
rimraf.sync(homedir)
|
rimraf.sync(homedir)
|
||||||
|
|
|
@ -25,76 +25,81 @@
|
||||||
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
|
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
|
||||||
|
|
||||||
Cypress.Commands.add("createApp", (name, description) => {
|
Cypress.Commands.add("createApp", (name, description) => {
|
||||||
cy.get('.banner-button')
|
cy.get(".banner-button")
|
||||||
.click()
|
.click()
|
||||||
.get('input[name="name"]')
|
.get('input[name="name"]')
|
||||||
.type(name).should('have.value', name)
|
.type(name)
|
||||||
|
.should("have.value", name)
|
||||||
|
|
||||||
cy.get('textarea[name="description"]')
|
cy.get('textarea[name="description"]')
|
||||||
.type(description).should('have.value', description)
|
.type(description)
|
||||||
|
.should("have.value", description)
|
||||||
|
|
||||||
cy.contains('Save').click()
|
cy.contains("Save").click()
|
||||||
})
|
})
|
||||||
Cypress.Commands.add("createModel", (modelName, firstField, secondField) => {
|
Cypress.Commands.add("createModel", (modelName, firstField, secondField) => {
|
||||||
// Enter model name
|
// Enter model name
|
||||||
cy.get('[data-cy=Name]').click()
|
cy.get("[data-cy=Name]")
|
||||||
|
.click()
|
||||||
.type(modelName)
|
.type(modelName)
|
||||||
|
|
||||||
// Add 'name' field
|
// Add 'name' field
|
||||||
cy.get('[data-cy=add-new-model-field]').click()
|
cy.get("[data-cy=add-new-model-field]").click()
|
||||||
cy.get('[data-cy=Name]').click()
|
cy.get("[data-cy=Name]")
|
||||||
|
.click()
|
||||||
.type(firstField)
|
.type(firstField)
|
||||||
cy.contains('Save').click()
|
cy.contains("Save").click()
|
||||||
|
|
||||||
|
|
||||||
// Add 'age' field
|
// Add 'age' field
|
||||||
cy.get('[data-cy=add-new-model-field]').click()
|
cy.get("[data-cy=add-new-model-field]").click()
|
||||||
|
|
||||||
cy.get('[data-cy=Name]').click()
|
cy.get("[data-cy=Name]")
|
||||||
|
.click()
|
||||||
.type(secondField)
|
.type(secondField)
|
||||||
cy.get('select').select('number')
|
cy.get("select").select("number")
|
||||||
cy.contains('Save').click()
|
cy.contains("Save").click()
|
||||||
cy.contains(secondField).should('exist')
|
cy.contains(secondField).should("exist")
|
||||||
|
|
||||||
// Save model
|
// Save model
|
||||||
cy.contains('Save').click()
|
cy.contains("Save").click()
|
||||||
})
|
})
|
||||||
Cypress.Commands.add("addRecord", (firstField, secondField) => {
|
Cypress.Commands.add("addRecord", (firstField, secondField) => {
|
||||||
cy.contains('Create new record')
|
cy.contains("Create new record").click()
|
||||||
.click()
|
|
||||||
|
|
||||||
cy.get('[data-cy=name-input]').click().type(firstField)
|
cy.get("[data-cy=name-input]")
|
||||||
cy.get('[data-cy=age-input]').click().type(secondField)
|
.click()
|
||||||
|
.type(firstField)
|
||||||
|
cy.get("[data-cy=age-input]")
|
||||||
|
.click()
|
||||||
|
.type(secondField)
|
||||||
|
|
||||||
// Save
|
// Save
|
||||||
cy.contains('Save').click()
|
cy.contains("Save").click()
|
||||||
})
|
})
|
||||||
|
|
||||||
Cypress.Commands.add("createUser", (username, password, level) => {
|
Cypress.Commands.add("createUser", (username, password, level) => {
|
||||||
// Create User
|
// Create User
|
||||||
cy.get('.nav-group-header > .ri-add-line')
|
cy.get(".nav-group-header > .ri-add-line").click()
|
||||||
.click()
|
|
||||||
|
|
||||||
cy.get('[data-cy=username]').type(username)
|
cy.get("[data-cy=username]").type(username)
|
||||||
cy.get('[data-cy=password]').type(password)
|
cy.get("[data-cy=password]").type(password)
|
||||||
cy.get('[data-cy=accessLevel]').select(level)
|
cy.get("[data-cy=accessLevel]").select(level)
|
||||||
|
|
||||||
// Save
|
// Save
|
||||||
cy.contains('Save').click()
|
cy.contains("Save").click()
|
||||||
})
|
})
|
||||||
|
|
||||||
Cypress.Commands.add("addHeadlineComponent", (text) => {
|
Cypress.Commands.add("addHeadlineComponent", text => {
|
||||||
cy.get('.switcher > :nth-child(2)').click()
|
cy.get(".switcher > :nth-child(2)").click()
|
||||||
|
|
||||||
cy.get('[data-cy=Text]').click()
|
cy.get("[data-cy=Text]").click()
|
||||||
cy.get('[data-cy=Headline]').click()
|
cy.get("[data-cy=Headline]").click()
|
||||||
cy.get('.tabs > :nth-child(2)').click()
|
cy.get(".tabs > :nth-child(2)").click()
|
||||||
cy.get('input[type="text"]')
|
cy.get('input[type="text"]').type(text)
|
||||||
.type(text)
|
cy.contains("Design").click()
|
||||||
cy.contains('Design').click()
|
|
||||||
})
|
})
|
||||||
Cypress.Commands.add("addButtonComponent", (text) => {
|
Cypress.Commands.add("addButtonComponent", () => {
|
||||||
cy.get('.switcher > :nth-child(2)').click()
|
cy.get(".switcher > :nth-child(2)").click()
|
||||||
|
|
||||||
cy.get('[data-cy=Button]').click()
|
cy.get("[data-cy=Button]").click()
|
||||||
})
|
})
|
|
@ -14,7 +14,7 @@
|
||||||
// ***********************************************************
|
// ***********************************************************
|
||||||
|
|
||||||
// Import commands.js using ES2015 syntax:
|
// Import commands.js using ES2015 syntax:
|
||||||
import './commands'
|
import "./commands"
|
||||||
|
|
||||||
// Alternatively you can use CommonJS syntax:
|
// Alternatively you can use CommonJS syntax:
|
||||||
// require('./commands')
|
// require('./commands')
|
||||||
|
|
|
@ -41,6 +41,11 @@
|
||||||
"/node_modules/(?!svelte).+\\.js$"
|
"/node_modules/(?!svelte).+\\.js$"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"eslintConfig": {
|
||||||
|
"extends": [
|
||||||
|
"plugin:cypress/recommended"
|
||||||
|
]
|
||||||
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@beyonk/svelte-notifications": "^2.0.3",
|
"@beyonk/svelte-notifications": "^2.0.3",
|
||||||
"@budibase/bbui": "^1.1.1",
|
"@budibase/bbui": "^1.1.1",
|
||||||
|
|
|
@ -1980,6 +1980,13 @@ escape-string-regexp@^1.0.5:
|
||||||
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
|
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
|
||||||
integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
|
integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
|
||||||
|
|
||||||
|
eslint-plugin-cypress@^2.11.1:
|
||||||
|
version "2.11.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/eslint-plugin-cypress/-/eslint-plugin-cypress-2.11.1.tgz#a945e2774b88211e2c706a059d431e262b5c2862"
|
||||||
|
integrity sha512-MxMYoReSO5+IZMGgpBZHHSx64zYPSPTpXDwsgW7ChlJTF/sA+obqRbHplxD6sBStE+g4Mi0LCLkG4t9liu//mQ==
|
||||||
|
dependencies:
|
||||||
|
globals "^11.12.0"
|
||||||
|
|
||||||
eslint-plugin-prettier@^3.1.2:
|
eslint-plugin-prettier@^3.1.2:
|
||||||
version "3.1.2"
|
version "3.1.2"
|
||||||
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.2.tgz#432e5a667666ab84ce72f945c72f77d996a5c9ba"
|
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.2.tgz#432e5a667666ab84ce72f945c72f77d996a5c9ba"
|
||||||
|
@ -2526,7 +2533,7 @@ glob@^7.0.3, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4:
|
||||||
once "^1.3.0"
|
once "^1.3.0"
|
||||||
path-is-absolute "^1.0.0"
|
path-is-absolute "^1.0.0"
|
||||||
|
|
||||||
globals@^11.1.0:
|
globals@^11.1.0, globals@^11.12.0:
|
||||||
version "11.12.0"
|
version "11.12.0"
|
||||||
resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e"
|
resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e"
|
||||||
integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==
|
integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==
|
||||||
|
|
Loading…
Reference in New Issue