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

Add testing radio button with listener #6

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Add testing radio button with listener #6

wants to merge 7 commits into from

Conversation

gal-shvetsova
Copy link

No description provided.

radioButtons[5].setText("Choice 5");

radioButtons[5].addSelectionListener(new SelectionAdapter() {
@Override

Choose a reason for hiding this comment

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

Bad indentation

Copy link
Author

Choose a reason for hiding this comment

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

fixed


private void selectionChange() {
boolean buttonSelected = radioButtons[5].getSelection();
radioButtons[1].setEnabled(!buttonSelected);

Choose a reason for hiding this comment

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

Unintended side-effect. We are testing, that a button received deselection event, if listener itself produces more events, this may lead to false negatives.

Copy link
Author

Choose a reason for hiding this comment

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

fixed


private void selectionChange() {
boolean buttonSelected = radioButtons[5].getSelection();
text.setText(buttonSelected ? "selected" : "");

Choose a reason for hiding this comment

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

A would recommend not use empty string here. "unselected" would be better visible on screenshots and easier to assert.

Copy link
Author

Choose a reason for hiding this comment

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

fixed

@@ -6,8 +6,8 @@ Element-Type: testcase
Element-Version: 3.0
External-Reference:
Id: _UPfZgJa6EeK184kZHmPTQQ
Runtime-Version: 1.5.6.qualifier
Save-Time: 4/1/15 12:04 PM
Runtime-Version: 2.5.1.202004201035

Choose a reason for hiding this comment

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

Where is the test for text change when a button is deselected?

Copy link
Author

Choose a reason for hiding this comment

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

added

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

Successfully merging this pull request may close these issues.

2 participants