Skip to content

Commit

Permalink
feat(tests): add possibility to run e2e tests for different bs versio…
Browse files Browse the repository at this point in the history
…ns (#4886)
  • Loading branch information
ludmilanesvitiy authored and valorkin committed Dec 4, 2018
1 parent c0b1870 commit 86436ca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 6 additions & 2 deletions cypress/plugins/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
const cypressTypeScriptPreprocessor = require('./cy-ts-preprocessor');

module.exports = on => {
on('file:preprocessor', cypressTypeScriptPreprocessor)
module.exports = (on, config) => {
on('file:preprocessor', cypressTypeScriptPreprocessor);

config.env.bsVersion = process.env.bsVersion ? process.env.bsVersion : false;

return config
};
3 changes: 2 additions & 1 deletion cypress/support/base.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ export abstract class BaseComponent {
titleDefaultExample = 'Usage';

navigateTo() {
cy.visit(this.pageUrl);
const bsVersionRoute = Cypress.env('bsVersion') ? `?_bsVersion=bs${Cypress.env('bsVersion')}` : '';
cy.visit(`${ this.pageUrl }${bsVersionRoute}`);
}

scrollToMenu(subMenu: string) {
Expand Down

0 comments on commit 86436ca

Please sign in to comment.