How to: Install Codeception on Ubuntu

Part of a BDD WordPress article.

Run provisioning script

I have tested this on Ubuntu 16. This script might take up to 20 minutes to run. This assumes you have an Ubuntu instance running in the cloud, and you want to develop a plugin or theme.

Open a terminal, and enter this command:

  • source <(curl -s https://raw.githubusercontent.com/johndeebdd/Remote-BDD-Setup/master/installScripts/wordpress.sh)

    Source: Github

Now we’ll download a plugin from Git, and we’ll run the test framework. Enter these commands:

  • source <(curl -s https://raw.githubusercontent.com/johndeebdd/Remote-BDD-Setup/master/installScripts/installplugin.sh)
  • https://github.com/JohnDeeBDD/remove-gdpr.git
  • remove-gdpr

Launch another terminal to run PhantomJS. Open and enter these commands:

cd /var/www/html/wp-content/plugins/WPbdd
./phantomjs --webdriver=4444

From the first terminal you should be able to run the suite:

bin/codecept run acceptance -vvv --html

  • Back to the Beginning
  • Setup an Ubuntu instance, i.e. on AWS. You should be able to do this on any cloud based Ubuntu machine or laptop.
  • Create a local key pair on your machine and connect to your instance. This is the Amazon security authentication system.
  • Install and update software
  • Tutorial: Setup cloud based Dev server for PHP / WordPress using Codeception

    Part of a BDD WordPress article.

    These directions will setup a a Behavior Driven Development (BDD) environment, for WordPress in the cloud using Codeception. It will setup a WordPress install in the cloud, pull down a plugin from Github, and setup an IDE as well as a test suite. You can use this dev cloud environment to engage outsourcers or remote teams.

    1. Setup an Ubuntu instance, i.e. on AWS. You should be able to do this on any cloud based Ubuntu machine or laptop.
    2. Create a local key pair on your machine and connect to your instance. This is the Amazon security authentication system. The goal is a clean Ubuntu machine. You could use another service [like Google or Cloud9] or even a localhost. Open ports 4444 and 80.
    3. Install and update software.

    The IDE is at:

    • http://your-domain.com/codiad/

    Setup an AWS Instance

    Instructions to setup an AWS instance.

    Setup an Amazon Web Services (AWS) account. You will need a credit or debit card. If you sign up for ‘free tier’ this shouldn’t cost much or anything.
    Login to Amazon AWS.
    Go to the AWS EC2 Management Console.
    Click Elastic IPs.
    Click Allocate New Address.
    Click Allocate.
    Click Security Groups.
    Click Create Security Group.
    Fill in “Security group name” with “SG1”.
    Open these ports with Custom TCP rules:

    • HTTP TCP 80
    • SSH TCP 22
    • HTTPS TCP 443
    • PhantomJS 4444
    • ChromeDriver 9515

    Click Save.
    Click Key Pairs.
    Click Create Key Pair.
    Name it “KP1” and create.
    Click Running Instances.
    Click Launch Instance.
    Select the 64bit “Ubuntu Server 16.04 LTS”.
    Select T2 micro.
    Click Configure Instance Details.
    Click Next until you get to the “Configure Security Groups” page.
    Select Select an existing security group.
    Choose the SG1 group you just created.
    Click Launch until you get to the “Select a key pair” screen.
    Select key pair KP1 you just created.

    Keywords:

    Amazon Web Services instance
    public/private key pair
    secure shell (SSH)
    Elastic IPs

  • Back to the Beginning
  • Setup an Ubuntu instance, i.e. on AWS. You should be able to do this on any cloud based Ubuntu machine or laptop.
  • Create a local key pair on your machine and connect to your instance. This is the Amazon security authentication system.
  • Install and update software
  • WordPress Plugin: CRG FastRegister

    Streamline WordPress’ user registration system to login users BEFORE they confirm their emails.

    Try it, just enter your email into the
    Sign Up for My Newsletter
    box on the right!

    WordPress has a very clunky registration system. First the user gives their email, then the system emails them a code, then the user has to copy and paste the code to login. A simpler solution is to trust the user about their email on their first login, and then just log them in. This plugin creates a sidebar widget that asks for the user’s email. If they enter a new email, they immediately get logged in. If they enter an existing email, they are forwarded to the standard login page with their email already filled out. This plugin does away with “user names” and just uses email. It also changes the English label “Username” to “Email” in the login form. Finally, it automatically creates a “Nickname” when the user registers. It is an appended email, so “John@doe.com” would be given the automatic nickname “John”. This plugin should work on any site. Activate it and set the sidebar widget and you’re ready to go.

    Source: github.com