Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Codeceptjs 3. #5

Closed
cbruyndoncx opened this issue Dec 28, 2020 · 5 comments
Closed

Codeceptjs 3. #5

cbruyndoncx opened this issue Dec 28, 2020 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@cbruyndoncx
Copy link

cbruyndoncx commented Dec 28, 2020

With the release of codecpetjs 3.0 there is a small syntax change
https://codecept.io/wiki/Upgrading-to-CodeceptJS-3.html

( I ) needs to become ( { I } )

I think the only required change is in the testgenerator file

@thiagodp
Copy link
Owner

Hello @cbruyndoncx , thank you for the suggestion. This will require upgrading concordialang-codeceptjs-core to version 2.x and derived packages to use codeceptjs@3.

I'm also planning to release Concordia 2 soon. Currently, version 1.x works with codeceptjs 2.x and Concordia 2-alpha.

@cbruyndoncx
Copy link
Author

Yes, I actually started wit a codeceptjs3 installation and installed concordia alongside.
I am just starting with codeceptjs for a project and the combo with concordialang looks promising. Can't wait for v2.0
I was wondering though I found the BNF grammar, but is there an editor you can use that understands the BNF and the other concordialang syntax ?

@thiagodp
Copy link
Owner

thiagodp commented Jan 3, 2021

Since Concordia is inspired by Gherkin, you can use some useful plugins for syntax highlighting.
Although, Concordia has its own reserved words (e.g., Variant, Table) and it would be great to have a fully-compatible plug-in.
The current documentation does not provide a BNF grammar.

An old and incomplete draft goes like this:

feature ::= white comment tags header background? feature_elements comment?
header ::= (!(scenario_outline | scenario | background | variant_background) .)*
feature_elements ::= (scenario | scenario_outline)*
scenario ::= comment tags scenario_keyword space* lines_to_keyword white steps
scenario_outline ::= comment tags scenario_outline_keyword space* lines_to_keyword white steps testcase_sections white
background ::= comment background_keyword space* lines_to_keyword? (eol+ | eof) steps
variant_background ::= comment variant_background_keyword space* lines_to_keyword? (eol+ | eof) steps
tags ::= white (tag (space|eol)+)*
tag ::= '@' ([^@\r\n\t ])+
comment ::= (comment_line white)*
comment_line ::= space* '#' line_to_eol
steps ::= step*
step ::= comment step_keyword keyword_space line_to_eol (eol+ | eof) multiline_arg? white
testcase_sections ::= testcase*
testcase ::= comment space* testcase_keyword space* lines_to_keyword? eol table white
multiline_arg ::=  table | py_string
py_string ::= open_py_string (!close_py_string .)* close_py_string
open_py_string ::= space* '"""' space* eol
close_py_string ::= eol space* '"""' white
cell ::= [^\r\n|]+ '|'
row ::= space* '|' cell+ eol
table ::= row+
step_keyword ::= 'Given' | 'When' | 'Then' | 'And' | 'But'
import_keyword ::= 'Import'
testcase_keyword ::= 'Test Case:'
scenario_outline_keyword ::= 'Scenario Outline:'
scenario_keyword ::= 'Scenario:'
background_keyword ::= 'Background:'
variant_keyword ::= 'Variant:'
variant_background_keyword ::= 'Variant Background:'
property_line ::= '-' space* property connectors content
property ::= [^\r\n|]+
connectors ::= [^\r\n|]+
content ::= value | number
value ::= '"' [^\r\n|]+ '"'
number ::= [0-9]+(\.[0-9]*)?
table_keyword ::= 'Table:'
database_keyword ::= 'Database:'
constants_keyword ::= 'Constants:'
ui_element_keyword ::= 'UI Element:'
ui_element_step_keyword ::= 'Otherwise' | 'And' | 'But'
test_event ::= 'Before All' | 'After All' | 'Before Feature' | 'After Feature' | 'Before Each Scenario' | 'After Each Scenario'
lines_to_keyword ::= (!(eol space* reserved_words_and_symbols) .)*
reserved_words_and_symbols ::= (step_keyword keyword_space) | (variant_background_keyword keyword_space) | scenario_keyword | scenario_outline_keyword | variant_keyword | variant_background_keyword | table_keyword | database_keyword | constants_keyword | ui_element_keyword | test_event | table | tag | comment_line | property_line
line_to_eol ::= (!eol .)*
space ::= ' ' | '\t'
eol ::= '\r'? '\n'
white ::= (space | eol)*
keyword_space ::= ' '

Such BNF would cover the basic syntax. Concordia Compiler uses Natural Language Processing to analyze actions and other constructions.

@thiagodp
Copy link
Owner

Hi @cbruyndoncx , while the support for CodeceptJS 3 isn't available, you can upgrade the produced (CodeceptJS 2) tests automatically using codecept3-upgrade, like this:

npx codecept3-upgrade tests

@thiagodp thiagodp self-assigned this May 15, 2021
@thiagodp thiagodp added the enhancement New feature or request label May 15, 2021
@thiagodp
Copy link
Owner

@cbruyndoncx Released in v1.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants