[yast-devel] UI unit testing and how to improve situation
Hi, I would like to discuss here how to improve situation with testing dialogs and UI stuff. I write some test and found some patterns are repeating, so maybe we can add it to our rspec helpers. My proposal is to add few methods: * simulate_input(*events) - which gets set of events that UserInput should return example usage: simulate_input(:help, :cancel, :start_service, :ok) * mock_query_widget(widget_id, data_type, *responses) - which mocks quering widget to return expected data example usage: mock_query_widget(Id(:path), :Value, "/dev/sda", "/dev/sdb") * expect_value_set(widget_id, data_type, new_value) - check that verify if dialog change value to expected value example usage: expect_value_set(Id(:start_service), :Enabled, false) What do you think about it? Do you find more useful helpers? And what is more important how looks your ui tests, so I can check what is same and can be shared? Josef -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
On 02/12/2015 11:56 AM, Josef Reidinger wrote:
What do you think about it? Do you find more useful helpers? And what is more important how looks your ui tests, so I can check what is same and can be shared?
To be honest, I don't remember to have written tests for UI in YaST. All I can say is that I'd like them be as interaction-oriented as the tests with Capybara in Rails, for example: https://github.com/openSUSE/travel-support-program/blob/master/spec/features... In the example, feature==describe, background==before, scenario==it. I'll do some experiments next week. We all probably need to write quite some tests for UI before being really able to design a good set of helpers. Cheers. -- Ancor González Sosa YaST Team at SUSE Linux GmbH -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
On Thu, 12 Feb 2015 14:22:34 +0100
Ancor Gonzalez Sosa
On 02/12/2015 11:56 AM, Josef Reidinger wrote:
What do you think about it? Do you find more useful helpers? And what is more important how looks your ui tests, so I can check what is same and can be shared?
To be honest, I don't remember to have written tests for UI in YaST. All I can say is that I'd like them be as interaction-oriented as the tests with Capybara in Rails, for example:
https://github.com/openSUSE/travel-support-program/blob/master/spec/features...
In the example, feature==describe, background==before, scenario==it.
I'll do some experiments next week. We all probably need to write quite some tests for UI before being really able to design a good set of helpers.
Cheers.
Well, what I see in example you post is more integration tests of ui, not unit tests. It looks really similar to e.g. cucumber for me. I think in unit tests you need more test interaction of units in program then effects for user. So for me unit tests is more test if it properly set configuration in conf class then what user see. But I agree with you, that it make sense to everyone try write some tests to get idea what is missing and make pain in writing such tests. Josef -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
participants (2)
-
Ancor Gonzalez Sosa
-
Josef Reidinger