Skip to content

Instantly share code, notes, and snippets.

View kafkadev's full-sized avatar
🏠
Working from home

Gokhan Celik kafkadev

🏠
Working from home
View GitHub Profile
@kafkadev
kafkadev / env.php
Created August 20, 2018 08:36 — forked from VirtuBox/env.php
env.php configuration example for magento 2.1 with redis cache
<?php
return array (
'backend' =>
array (
'frontName' => 'youradmin-url',
),
'crypt' =>
array (
'key' => 'thelongkey',
),
@kafkadev
kafkadev / ddd.md
Created August 10, 2018 14:53 — forked from zsup/ddd.md
Documentation-Driven Development (DDD)

Documentation-Driven Development

The philosophy behind Documentation-Driven Development is a simple: from the perspective of a user, if a feature is not documented, then it doesn't exist, and if a feature is documented incorrectly, then it's broken.

  • Document the feature first. Figure out how you're going to describe the feature to users; if it's not documented, it doesn't exist. Documentation is the best way to define a feature in a user's eyes.
  • Whenever possible, documentation should be reviewed by users (community or Spark Elite) before any development begins.
  • Once documentation has been written, development should commence, and test-driven development is preferred.
  • Unit tests should be written that test the features as described by the documentation. If the functionality ever comes out of alignment with the documentation, tests should fail.
  • When a feature is being modified, it should be modified documentation-first.
  • When documentation is modified, so should be the tests.
cd ~/_APP && mkdir -p pr2017_tests &&
cd ~/_APP/pr2017_tests &&
npm init -f &&
npm install g codeceptjs &&
npm install -g nightmare nightmare-upload &&
codeceptjs init
//Choose webdrive.io
@kafkadev
kafkadev / frameworks.md
Created August 1, 2018 14:16
Javascript End-to-End test frameworks.

CasperJS

Github | Site

  • Navigation scripting & testing for PhantomJS and SlimerJS.

Sample Code

casper.test.begin("Find 'casperjs' repository on GitHub", 1, function(test) {
    casper.start('http://github.com/', function() {
        this.waitForSelector('form[action="/search"]');
 }).then(function() {
@kafkadev
kafkadev / Example Gruntfile
Created August 1, 2018 14:09 — forked from austenc/Example Gruntfile
Example gruntfile with phantomjs / codeception integration, and asset building
'use strict';
var root = "~/Code/toolbox";
var bench = "~/Code/toolbox/workbench/hdmaster/nucleus";
var ssh = 'ssh vagrant@127.0.0.1 -p 2222 -t';
module.exports = function(grunt) {
grunt.initConfig({

Codecept JS

Prerequisites

  1. Node 8.9+
  2. Java VM

Use

@kafkadev
kafkadev / CallerPermission.php
Created August 1, 2018 13:23 — forked from zspine/CallerPermission.php
BeatSwitch lock doctrine example
<?php
//src/library/App/Entity/CallerPermission.php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="lock_caller_permission")
*/
@kafkadev
kafkadev / .htaccess
Created August 1, 2018 13:23 — forked from zspine/.htaccess
htaccess cheatsheet
#Hide directories and files
Options -Indexes
#Set Enviroment Varaibles
SetEnv APPLICATION_ENV "development"
# Enable the rewrite engine
RewriteEngine On
# redirect non www to www
@kafkadev
kafkadev / js
Created August 1, 2018 13:21 — forked from karogaw/js
codeceptjs3
{
"output": "./e2e/codecept/output",
"helpers": {
"WebDriverIO": {
"url": "http://testapp.com/",
"windowSize": "maximize",
"browser": [
"chrome",
"firefox"
]
@kafkadev
kafkadev / .js
Created August 1, 2018 13:21 — forked from karogaw/.js
codeceptJS3
Feature('user_creation @user', {retries: 3});
let mailbox;
Before((I, loginPage) => {
I.amOnPage('/login');
loginPage.sendForm()
});