Skip to content

Commit

Permalink
Merge branch 'release/2.2.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
matipojo committed Nov 1, 2018
2 parents 6a9843a + 386556e commit 13f70ba
Show file tree
Hide file tree
Showing 13 changed files with 141 additions and 129 deletions.
3 changes: 0 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,15 @@ job-references:
if [ -f /home/circleci/.bashrc ]; then
source /home/circleci/.bashrc
fi
install_dependencies: &install_dependencies
name: "Install Dependencies"
command: |
sudo docker-php-ext-install mysqli
install_wp_core: &install_wp_core
name: "Install WordPress Core"
command: |
rm -rf /tmp/wordpress-tests-lib /tmp/wordpress
bash bin/install-wp-tests.sh wordpress_test root '' 127.0.0.1 $WP_VERSION
php_job: &php_job
environment:
- WP_VERSION: "latest"
Expand Down
33 changes: 0 additions & 33 deletions .jscsrc

This file was deleted.

4 changes: 3 additions & 1 deletion bin/install-wordpress.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ until $(curl -L http://$HOST_IP:$HOST_PORT -so - 2>&1 | grep -q "WordPress"); do
done
echo ''

# If this is the test site, we reset the database so no posts/comments/etc.
# If Perform advanced options such as housekeeping, archiving, renaming, transferring, or removing your project.this is the test site, we reset the database so no posts/comments/etc.
# dirty up the tests.
echo -e $(status_message "Resetting test database...")
docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm -u 33:33 $CLI db reset --yes >/dev/null
Expand All @@ -52,6 +52,8 @@ echo -e $(status_message "Installing WordPress...")
# The `-u 33` flag tells Docker to run the command as a particular user and
# prevents permissions errors. See: https://github.com/WordPress/gutenberg/pull/8427#issuecomment-410232369
docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm -u 33 $CLI core install --title="$SITE_TITLE" --admin_user=admin --admin_password=password --admin_email=admin@localhost.local --skip-email --url=http://localhost:$HOST_PORT >/dev/null
docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm -u 33 $CLI config set AUTOSAVE_INTERVAL 2 --add --type=constant >/dev/null
docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm -u 33 $CLI config set DISABLE_WP_CRON true --add --type=constant >/dev/null

if [ "$WP_VERSION" == "latest" ]; then
# Check for WordPress updates, to make sure we're running the very latest version.
Expand Down
13 changes: 13 additions & 0 deletions cypress.json
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"
}
65 changes: 0 additions & 65 deletions nightwatch.conf.js

This file was deleted.

13 changes: 5 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,18 @@
"homepage": "https://elementor.com/",
"scripts": {
"test:phpunit": "docker-compose run --rm wordpress_phpunit phpunit",
"pree2e": "concurrently \"bash ./bin/reset-e2e-tests.sh || exit 0\" \"grunt || exit 0\"",
"e2e": "nightwatch",
"dev": "grunt && grunt watch"
"ci:setup": "concurrently \"bash ./bin/reset-e2e-tests.sh || exit 0\" \"grunt || exit 0\"",
"e2e": "cypress open"
},
"devDependencies": {
"autoprefixer": "~8.5.0",
"babel-core": "^6.26.3",
"babel-eslint": "^8.2.6",
"babel-loader": "^7.1.5",
"babel-preset-env": "^1.7.0",
"chromedriver": "^2.41.0",
"concurrently": "^4.0.1",
"cssnano": "~3.10.0",
"cypress": "^3.1.0",
"eslint": "^5.4.0",
"eslint-config-wordpress": "^2.0.0",
"eslint-loader": "^2.1.0",
Expand All @@ -45,9 +44,7 @@
"grunt-wp-readme-to-markdown-with-extra": "~2.2.0",
"load-grunt-tasks": "^4.0.0",
"path": "^0.12.7",
"selenium-server": "^3.14.0",
"uglifyjs-webpack-plugin": "^1.3.0",
"webpack": "^4.16.5",
"nightwatch": "^0.9.21"
"webpack": "^4.16.5"
}
}
}
19 changes: 0 additions & 19 deletions tests/e2e/editor-loaded.spec.js

This file was deleted.

5 changes: 5 additions & 0 deletions tests/e2e/fixtures/example.json
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"
}
10 changes: 10 additions & 0 deletions tests/e2e/integration/auto-save.spec.js
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' );
} );
} );
17 changes: 17 additions & 0 deletions tests/e2e/plugins/index.js
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.
};
59 changes: 59 additions & 0 deletions tests/e2e/support/commands.js
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();
} );
8 changes: 8 additions & 0 deletions tests/e2e/support/hooks.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/// <reference types="Cypress" />
before( function() {
cy.login();
} );

after( function() {

} );
21 changes: 21 additions & 0 deletions tests/e2e/support/index.js
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')

0 comments on commit 13f70ba

Please sign in to comment.