You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As an additional feature test with helper functions, we could also add tests to check the combination of inputs for all the encodings. This would be an extensive test, but it would thoroughly check the depth of combination input testing. I am adding an issue for this potential use case and discussion.
# Function to test all combinations of inputstest_input_combinations<-function(app_driver, input_ids, input_options, pws=NULL, tws=NULL) {
# Create a data frame of all possible combinations of encodingscombinations<- expand.grid(input_options, stringsAsFactors=FALSE)
names(combinations) <-input_ids# Iterate over each row in the combinations data framefor (iin seq_len(nrow(combinations))) {
# Determine the type of output to capture based on the input parametersif (!is.null(pws)) {
output_before<-app_driver$get_active_module_pws_output(pws)
output_type<-"pws"
} elseif (!is.null(tws)) {
output_before<-app_driver$get_active_module_tws_output(tws)
output_type<-"tws"
} else {
stop("Either pws or tws must be provided.")
}
# Set each input and check for errorsfor (jin seq_along(input_ids)) {
app_driver$set_active_module_input(input_ids[j], combinations[i, j])
app_driver$expect_no_validation_error()
}
if (output_type=="pws") {
testthat::expect_false(identical(output_before, app_driver$get_active_module_pws_output(pws)))
} else {
testthat::expect_false(identical(output_before, app_driver$get_active_module_tws_output(tws)))
}
}
}
# Example usageinput_ids<- c("input1", "input2", "input3")
input_options<-list(
c("option1_1", "option1_2"), # Input 1 has 2 options
c("option2_1", "option2_2", "option2_3", "option2_4", "option2_5",
"option2_6", "option2_7", "option2_8", "option2_9", "option2_10"), # Input 2 has 10 options
c("option3_1", "option3_2", "option3_3", "option3_4", "option3_5", "option3_6") # Input 3 has 6 options
)
# Fun call
test_input_combinations(app_driver, input_ids, input_options, "example_pws")
Code of Conduct
I agree to follow this project's Code of Conduct.
Contribution Guidelines
I agree to follow this project's Contribution Guidelines.
Security Policy
I agree to follow this project's Security Policy.
The text was updated successfully, but these errors were encountered:
Feature description
extension to this :#1135
As an additional feature test with helper functions, we could also add tests to check the combination of inputs for all the encodings. This would be an extensive test, but it would thoroughly check the depth of combination input testing. I am adding an issue for this potential use case and discussion.
Code of Conduct
Contribution Guidelines
Security Policy
The text was updated successfully, but these errors were encountered: