Skip to content

Instantly share code, notes, and snippets.

@novia713
Created December 16, 2019 13:44
Show Gist options
  • Save novia713/96ab6fc89bdd2d7b37ee050f743e0bb7 to your computer and use it in GitHub Desktop.
Save novia713/96ab6fc89bdd2d7b37ee050f743e0bb7 to your computer and use it in GitHub Desktop.
Activity feature for CA2M behat
default:
formatters:
pretty:
verbose: true
paths: false
snippets: true
suites:
default:
contexts:
- FeatureContext
- Drupal\DrupalExtension\Context\DrupalContext
- Drupal\DrupalExtension\Context\MinkContext
- Drupal\DrupalExtension\Context\MessageContext
- Drupal\DrupalExtension\Context\DrushContext
gherkin:
cache: ~
extensions:
Behat\MinkExtension:
goutte: ~
sessions:
default:
goutte:
guzzle_parameters:
verify: false
javascript_session: selenium2
selenium2:
wd_host: 'http://hub:4444/wd/hub'
browser_name: 'chrome'
base_url: 'http://nginx'
Drupal\DrupalExtension:
text:
log_out: "Cerrar sesión"
log_in: "Iniciar sesión"
password_field: "Contraseña"
username_field: "Nombre de usuario"
blackbox: ~
drush_driver: 'drush'
drush:
root: '/var/www/html/web'
api_driver: 'drupal'
drupal:
drupal_root: '/var/www/html/web'
Feature: Como Redactor
Quiero crear una actividad.
@api @create @activity @redactor @sunnyday @javascript
Scenario: Como redactor puedo crear una actividad.
Given I am logged in as a user with the "Redactor" role
When I go to "/node/add/actividades"
Given "actividades" content:
| title | field_tipo_actividad | field_actividad_ciclo | field_actividad_fechas_ciclo_start | field_actividad_fechas_ciclo_end | language |
| Test Behat | Cine y vídeo | true | 01/01/2020 | 01/01/2020 | es |
# Información general.
Then I should see "Título"
And I should see "Subtítulo"
And I should see "Entradilla"
# Categorización.
When I scroll to ".content-header"
And I click "Categorización"
Then I should see "Categoría cabecera"
And I should see "Temas"
And I should see "Tipo de actividad"
#When I scroll to ".content"
# Contenido principal
When I scroll to ".content-header"
And I click "Contenido principal"
Then I should see "Fechas texto cabecera"
And I should see "Comisariado"
And I should see "Dirigido por"
When I scroll to ".content-header"
And I click "Archivos y multimedia"
Then I should see "Imagen de la actividad"
When I scroll to ".content-header"
And I click "Colaboraciones"
Then I should see "COLABORA"
When I scroll to ".content-header"
And I click "Información general"
And I fill in "Título" with "behat-actividad"
And I fill in "Subtítulo" with "yyyy-mm-dd-9999-actividad_behat"
When I scroll to ".content-header"
And I click "Categorización"
And I fill in "edit-field-tipo-actividad-0-target-id" with "Cine y vídeo"
And I press "Guardar"
Then I wait 2
And I should see "Actividades behat-actividad se ha creado."
version: "3.6"
#networks:
#default:
#external:
#name: mynet
services:
php:
environment:
PHP_FPM_CLEAR_ENV: "no"
NO_PROXY: "127.0.0.1, localhost, .mynet, nginx, hub"
volumes:
- ./:/var/www/html:delegated
traefik:
# https://stackoverflow.com/questions/48851190/docker-compose-override-a-ports-property-instead-of-merging-it
image: traefik:v1.7.16-alpine
ports:
- '8000:80'
- '8080:8080' # Dashboard
chrome:
image: selenium/node-chrome:3.11.0-dysprosium
container_name: "${PROJECT_NAME}_chrome"
volumes:
- /dev/shm:/dev/shm
- ./:/var/www/html:cached # User-guided caching
depends_on:
- hub
environment:
HUB_HOST: hub
hub:
image: selenium/hub:3.11.0-dysprosium
container_name: "${PROJECT_NAME}_hub"
volumes:
- ./:/var/www/html:cached # User-guided caching
phantomjs:
image: wernight/phantomjs:2.1.1
container_name: "${PROJECT_NAME}_phantomjs"
command: phantomjs --webdriver=8910
#ports:
# - "4444:4444"
volumes:
codebase:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment