forked from elementor/elementor
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
141 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"projectId": "uta8ca", | ||
"watchForFileChanges": false, | ||
"baseUrl": "http://localhost:4001", | ||
"pageLoadTimeout": 10000, | ||
"integrationFolder": "tests/e2e/integration", | ||
"supportFile": "tests/e2e/support/index.js", | ||
"pluginsFile": "tests/e2e/plugins/index.js", | ||
"fixturesFolder": "tests/e2e/fixtures", | ||
"fileServerFolder": "log/application-data", | ||
"screenshotsFolder": "log/screenshots", | ||
"videosFolder": "log/videos" | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/// <reference types="Cypress" /> | ||
|
||
describe( 'Test If The Editor Load', () => { | ||
it( 'Should Load', () => { | ||
cy.visit( '/wp-admin' ); | ||
|
||
cy.addElementorPage(); | ||
cy.get( '[id=elementor-loading]' ).should( 'be.hidden' ); | ||
} ); | ||
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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` is used to hook into various events Cypress emits. | ||
// `config` is the resolved Cypress config. | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/// <reference types="Cypress" /> | ||
// *********************************************** | ||
// 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) => { ... }) | ||
|
||
Cypress.Commands.add( 'iframe', { prevSubject: 'element' }, ( $iframe ) => { | ||
return new Cypress.Promise( ( resolve ) => { | ||
$iframe.on( 'load', () => { | ||
resolve( $iframe.contents().find( 'body' ) ); | ||
} ); | ||
} ); | ||
} ); | ||
|
||
Cypress.Commands.add( 'login', () => { | ||
cy.request( { | ||
url: '/wp-login.php', // assuming you've exposed a seeds route | ||
method: 'POST', | ||
form: true, | ||
headers: { | ||
wordpress_test_cookie: 'WP+Cookie+check', | ||
}, | ||
body: { | ||
log: 'admin', | ||
pwd: 'password', | ||
'wp-submit': 'LogIn', | ||
redirect_to: '/wp-admin/', | ||
testcookie: 1, | ||
}, | ||
} ); | ||
} ); | ||
|
||
Cypress.Commands.add( 'addElementorPage', () => { | ||
cy.visit( '/wp-admin/post-new.php?post_type=page' ); | ||
cy.get( '[id=content-html]' ).click(); | ||
cy.get( '[id=content]' ).type( 'Elementor' ); | ||
cy.get( '[id=elementor-switch-mode-button]' ).click(); | ||
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/// <reference types="Cypress" /> | ||
before( function() { | ||
cy.login(); | ||
} ); | ||
|
||
after( function() { | ||
|
||
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// *********************************************************** | ||
// 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 './hooks'; | ||
import './commands'; | ||
|
||
// Alternatively you can use CommonJS syntax: | ||
// require('./commands') |