Skip to content

Commit

Permalink
Update tips and tricks and actions' documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagodp committed Aug 19, 2019
1 parent c8f3a7b commit d9cd080
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 27 deletions.
5 changes: 3 additions & 2 deletions docs/en/actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

Translations: [Português](../pt/actions.md) 🌎

---

## `accept`

Expand Down Expand Up @@ -42,7 +43,7 @@ Given that I am on "http://concordialang.org"

## `append`

> Adds a value to a widget (UI Element or UI Literal).
> Adds a value to an element.
### append + number + target
```gherkin
Expand All @@ -59,7 +60,7 @@ When I append 100 to {Bar}

## `attachFile`

> Attaches a file. It selects the file and confirm its choice (i.e., clicks OK).
> Attaches a file. It selects a file and confirms its choice (e.g., clicks Open).
### attach + file + value + target
```gherkin
Expand Down
15 changes: 8 additions & 7 deletions docs/en/tips-and-tricks.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ Add the tag `@ignore` to a Feature, Scenario, Variant or Test Case, in order to

## How to generate HTML reports with CodeceptJS:

1. Install **mochawesome** as a *development* dependency:
1. Install **mochawesome** and **mochawesome-report-generator** as *development* dependencies:

```bash
npm install --save-dev mochawesome
npm install --save-dev mochawesome mochawesome-report-generator
```

2. Edit `codecept.json` and add **mochawesome** to `reporterOptions`:
Expand All @@ -38,7 +38,7 @@ Add the tag `@ignore` to a Feature, Scenario, Variant or Test Case, in order to
"options": {
"reportDir": "./output",
"reportFilename": "report",
"timestamp": true,
"overwrite": false,
"autoOpen": true
}
}
Expand All @@ -47,12 +47,13 @@ Add the tag `@ignore` to a Feature, Scenario, Variant or Test Case, in order to
...
```

The reports will be generared to the folder `output`.
The reports will be generated to the folder `output`.

Extra tips:
- Option `timestamp` makes it to generate a different report name on every execution. This is fine when you have to keep all the reports for historical reasons or audit. You may remove this option or turn it to `false` if it is not the case.
*Notes:*
- Option `overwrite` makes it to avoid overwriting the generated file. This usually generates a different file names each time, such as `mochawesome_001.html`, `mochawesome_002.html` and so on.
- Option `autoOpen` makes it to open the generated report with the default browser after the tests are finished.
- See [additional report options](https://github.com/adamgruber/mochawesome-report-generator).

👉 **See the [Mochawesome Report Generator's documentation](https://github.com/adamgruber/mochawesome-report-generator/) for more details.**


# How to speed up your browser tests
Expand Down
87 changes: 77 additions & 10 deletions docs/pt/actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,77 @@

*Exemplos de sentenças de Variantes com ações. Um exemplo pode demonstrar variações de uma mesma ação.*

## O que você deseja fazer?

> Aqui estão *algumas* opções, não todas.
- [Abrir painel de notificações de um dispositivo](#open)
- [Aceitar uma mensagem do navegador ou do app](#accept)
- [Adicionar um valor em um elemento](#append)
- [Anexar um arquivo](#attachfile)
- [Apagar um cookie](#clear--cookie)
- [Arrastar e soltar algo para um determinado elemento](#drag)
- [Atualizar a página atual](#refresh)
- [Balançar ou fazer um dispositivo tremer](#shake)
- [Cancelar uma mensagem do navegador ou do app](#cancel)
- [Clicar em algo na tela](#click)
- [Clicar com o botão direito em algo](#rightclick)
- [Conectar a um banco de dados](#connect)
- [Dar um duplo clique em algo](#doubleclick)
- [Desconectar de um banco de dados](#disconnect)
- [Desmarcar um elemento](#uncheck)
- [Deslizar a tela em um dispositivo](#swipe)
- [Deslizar um elemento, na tela em um dispositivo](#swipe)
- [Deslizar um elemento para outro, na tela em um dispositivo](#swipe--from--to)
- [Desinstalar um app pelo seu nome interno](#remove)
- [Esperar por um elemento](#wait--target)
- [Esperar por um elemento estar dentro de outro](#wait--option-value--value--target)
- [Esperar por um texto](#wait--text--value)
- [Esperar por uma URL](#wait--url--value)
- [Esperar um tempo](#wait)
- [Esperar um elemento ficar habilitado](#wait--target--enabled)
- [Esperar um elemento ficar invisível](#wait--target--invisible)
- [Esperar um elemento ficar visível](#wait--target--visible)
- [Executar um comando no console/terminal ou um script de banco de dados (comando SQL)](#run)
- [Extrair um recurso de um dispositivo para um determinado local](#pull)
- [Fechar uma aba ou janela do navegador, ou um app](#close)
- [Indicar uma página ou tela do app em que se espera estar](#amon)
- [Indicar que algo pode ou não ser visto](#see)
- [Instalar um app](#install)
- [Limpar o conteúdo de um campo de entrada](#clear)
- [Marcar uma caixa de marcação (checkbox)](#check)
- [Maximizar uma janela ou o navegador](#maximize)
- [Mover o cursor do mouse para um local ou elemento](#move)
- [Ocultar o teclado do dispositivo](#hide)
- [Preencher um campo](#fill)
- [Pressionar uma tecla ou uma combinação de teclas](#press)
- [Redimensionar uma janela](#resize)
- [Rolar a tela até um certo elemento](#scrollto)
- [Selecionar o valor de um elemento](#select)
- [Tirar uma foto da tela](#savescreenshot)
- [Tocar em um elemento da tela de um dispositivo](#tap)
- [Trocar o modo de um dispositivo de nativo para web ou vice-versa](#switch)
- [Verificar se a orientação do dispositivo é paisagem](#see--orientation--landscape)
- [Verificar se a orientação do dispositivo é retrato](#see--orientation--portrait)
- [Verificar seu um app está instalado](#see--app--value--installed)
- [Verificar seu uma atividade o app está ativa](#see--currentactivity--value)
- [Verificar se elemento está visível](#see--target)
- [Verificar se elemento está habilitado](#see--target--enabled)
- [Verificar se elemento está marcado](#see--target--checked)
- [Verificar a url do navegador](#see--url--value)
- [Verificar se o título da janela/aba do navegador tem um certo valor](#see--value--inside--title)
- [Verificar se um dispositivo está com a tela bloqueada](#see--device--locked)
- [Verificar se um valor está visível](#see--text--value-or-number)
- [Verificar se um valor está dentro de um elemento](#see--value--inside--target)
- [Verificar se um valor está em um título](#see--value--inside--title)
- [Verificar se um valor está visível](#see--value)
- [Verificar se um cookie existe](#see--cookie--value)

---

## `accept`

> Aceita uma mensagem do navegador ou do app
> Aceita uma mensagem do navegador ou do app.
### accept + alert
```gherkin
Expand All @@ -30,7 +97,7 @@ Quando eu aceito o prompt

## `amOn`

> Indica uma página ou tela do app em que se espera estar
> Indica uma página ou tela do app em que se espera estar.
```gherkin
Dado que estou em "http://concordialang.org"
Expand All @@ -39,7 +106,7 @@ Dado que estou em "http://concordialang.org"

## `append`

> Adiciona um valor em um widget (Elemento de IU ou Literal de IU)
> Adiciona um valor em um elemento.
```gherkin
Quando eu adiciono "Conteúdo" em {Foo}
Expand Down Expand Up @@ -88,7 +155,7 @@ Quando eu cancelo o prompt

## `check`

> Marca uma caixa de seleção (checkbox).
> Marca uma caixa de marcação (checkbox).
### check + target

Expand All @@ -99,7 +166,7 @@ Quando eu marco {Foo}

### check + target + target

Marca um elemento que está dentro de outro:
> Marca uma caixa de marcação (checkbox) que está dentro de outro
```gherkin
Então eu marco {Foo} em <#bar>
```
Expand Down Expand Up @@ -145,7 +212,7 @@ Quando eu clico em "Foo"

## `close`

> Fecha uma aba ou um app.
> Fecha uma aba ou janela do navegador, ou um app.
```gherkin
Quando eu fecho a aba atual
Expand Down Expand Up @@ -199,7 +266,7 @@ Quando eu clico duas vezes em "Foo"

## `drag`

> Arrasta e solta algo para um determinado widget.
> Arrasta e solta algo para um determinado elemento.
```gherkin
Quando eu arrasto {Foo} para <#bar>
Expand Down Expand Up @@ -504,16 +571,16 @@ Quando eu rolo para <#foo>

## `see`

> Indica que algo pode ser visto.
> Indica que algo pode ou não ser visto.
### see + value
```gherkin
Então eu não vejo "Foo Bar"
Então eu vejo "Foo Bar"
```

### see + not + value
```gherkin
Então eu não vejo que {Foo} está marcado
Então eu não vejo "Foo Bar"
```

### see + app + value + installed
Expand Down
15 changes: 7 additions & 8 deletions docs/pt/tips-and-tricks.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ Add the tag `@ignore` to a Feature, Scenario, Variant or Test Case, in order to

## How to generate HTML reports with CodeceptJS:

1. Install **mochawesome** as a *development* dependency:
1. Install **mochawesome** and **mochawesome-report-generator** as *development* dependencies:

```bash
npm install --save-dev mochawesome
npm install --save-dev mochawesome mochawesome-report-generator
```

2. Edit `codecept.json` and add **mochawesome** to `reporterOptions`:
Expand All @@ -40,7 +40,7 @@ Add the tag `@ignore` to a Feature, Scenario, Variant or Test Case, in order to
"options": {
"reportDir": "./output",
"reportFilename": "report",
"timestamp": true,
"overwrite": true,
"autoOpen": true
}
}
Expand All @@ -49,12 +49,11 @@ Add the tag `@ignore` to a Feature, Scenario, Variant or Test Case, in order to
...
```

The reports will be generared to the folder `output`.

Extra tips:
- Option `timestamp` makes it to generate a different report name on every execution. This is fine when you have to keep all the reports for historical reasons or audit. You may remove this option or turn it to `false` if it is not the case.
*Notes:*
- Option `overwrite` makes it to avoid overwriting the generated file. This usually generates a different file names each time, such as `mochawesome_001.html`, `mochawesome_002.html` and so on.
- Option `autoOpen` makes it to open the generated report with the default browser after the tests are finished.
- See [additional report options](https://github.com/adamgruber/mochawesome-report-generator).

👉 **See the [Mochawesome Report Generator's documentation](https://github.com/adamgruber/mochawesome-report-generator/) for more details.**


# How to speed up your browser tests
Expand Down

0 comments on commit d9cd080

Please sign in to comment.