Skip to content

Comments

#153 | Widget automated tests fixed and refactored#226

Merged
szymon-owczarzak merged 9 commits intomasterfrom
cypress-tests-fix
Jan 21, 2020
Merged

#153 | Widget automated tests fixed and refactored#226
szymon-owczarzak merged 9 commits intomasterfrom
cypress-tests-fix

Conversation

@szymon-owczarzak
Copy link
Contributor

Trying to fix this annoying bug that causes our tests to fail randomly.


I hereby agree to the terms of the Cogboard Contributor License Agreement.

@szymon-owczarzak szymon-owczarzak added the bug Something isn't working label Jan 17, 2020
@szymon-owczarzak szymon-owczarzak changed the title Trying to fix tests Widget automated tests fixed and refactored #153 Jan 21, 2020
@szymon-owczarzak szymon-owczarzak changed the title Widget automated tests fixed and refactored #153 #153 | Widget automated tests fixed and refactored Jan 21, 2020

export function fillDynamicTab(type = 'Text', version = '') {
const name = `${type}${version}`;
if (name !== 'White Space' && name !== 'Checkbox') {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets get rid of this if so we don't need to change this in future

@@ -0,0 +1,79 @@
import { fillDynamicTab } from './widgetDynamicTab'

class Widget {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Encapsulates widget configuration, and widget related assertions.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe it is worth mention about it in readme.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that is true and i will, but after i finish refactoring - this is just a part of refactor not the final structure.
I want to unblock all hanging PR for now.

const name = Widgets[widget].name;
const title = `Test-${name}`;
let version = '';
if (name == 'SonarQube') {
Copy link
Contributor Author

@szymon-owczarzak szymon-owczarzak Jan 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets get rid of this if and make tests less spagetized

name: 'AEM Healthcheck',
endpoint: 'endpoint1',
schedulePeriod: '500',
schedulePeriod: '3',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does it mean widget is refreshed each 3 millisecond during the test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

every 3 seconds until it is deleted

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure it is 3 seconds? Does it mean it was set to 500 seconds previously?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I'm sure.

@@ -0,0 +1,79 @@
import { fillDynamicTab } from './widgetDynamicTab'

class Widget {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe it is worth mention about it in readme.

@szymon-owczarzak szymon-owczarzak merged commit 12b28bd into master Jan 21, 2020
@szymon-owczarzak szymon-owczarzak deleted the cypress-tests-fix branch January 21, 2020 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants