test: multiple cypress fixes

This commit is contained in:
Sagar Vora 2021-04-18 13:22:43 +05:30
parent 2bf968e753
commit c8763859ae
3 changed files with 8 additions and 8 deletions

View file

@ -1,7 +1,4 @@
context('Relative Timeframe', () => { context('Relative Timeframe', () => {
beforeEach(() => {
cy.login();
});
before(() => { before(() => {
cy.login(); cy.login();
cy.visit('/app/website'); cy.visit('/app/website');

View file

@ -1,5 +1,5 @@
context('Table MultiSelect', () => { context('Table MultiSelect', () => {
beforeEach(() => { before(() => {
cy.login(); cy.login();
}); });

View file

@ -11,7 +11,7 @@ import click
import frappe import frappe
from frappe.commands import get_site, pass_context from frappe.commands import get_site, pass_context
from frappe.exceptions import SiteNotSpecifiedError from frappe.exceptions import SiteNotSpecifiedError
from frappe.utils import get_bench_path, update_progress_bar from frappe.utils import get_bench_path, update_progress_bar, cint
@click.command('build') @click.command('build')
@ -567,11 +567,14 @@ def run_ui_tests(context, app, headless=False):
node_bin = subprocess.getoutput("npm bin") node_bin = subprocess.getoutput("npm bin")
cypress_path = "{0}/cypress".format(node_bin) cypress_path = "{0}/cypress".format(node_bin)
plugin_path = "{0}/cypress-file-upload".format(node_bin) plugin_path = "{0}/../cypress-file-upload".format(node_bin)
# check if cypress in path...if not, install it. # check if cypress in path...if not, install it.
if not (os.path.exists(cypress_path) or os.path.exists(plugin_path)) \ if not (
or not subprocess.getoutput("npm view cypress version").startswith("6."): os.path.exists(cypress_path)
and os.path.exists(plugin_path)
and cint(subprocess.getoutput("npm view cypress version")[:1]) >= 6
):
# install cypress # install cypress
click.secho("Installing Cypress...", fg="yellow") click.secho("Installing Cypress...", fg="yellow")
frappe.commands.popen("yarn add cypress@^6 cypress-file-upload@^5 --no-lockfile") frappe.commands.popen("yarn add cypress@^6 cypress-file-upload@^5 --no-lockfile")