I need to test an application through UI where there are two panels.
One being available items and the other is selected items
These panes can contain thousands of items
Each available item has a checkbox used to select it and then the add button will add it to the selected pane.
My problem is there is virtual scrolling implemented on the panels.
Meaning I can only ever access a maximum of 16 items at a time,
(I've tried scrolling down to the bottom - but still, css selectors only work for the items I can see on the screen)
My Question is what is the best way to test this in terms of moving items from one panel to the next?
Possible approaches:
1) Move available items over to the selected items list (16 at a time) and assert they 16 got moved correctly ?
2) Move items over one by one asserting as I go they moved ok
3) Save all available items to a list then add them all over and compared the selected items to the saved list.
Could threading be an option?
Arquillian, Drone and Graphene are used so tests are done with page objects using Java
Related
I'm creating a kiosk style application which displays custom ScheduleItem components (extends BorderPane) in a VBox.
I plan to provide the controller with a List<ScheduleItem> fullSchedule which it will use to populate the VBox.
What I need to do is check that the next item will fit in the remaining free space of the VBox before I add it, and if not, remember the position in the list and start from there when the scene is refreshed.
This will potentially run on both landscape and portrait screens, so I need a way to dynamically calculate the number of possible events per page.
The ScheduleItem components differ slightly in height depending on content of each item, so ideally the calculation will be performed for each item to be added.
This would throw a spanner in the works for my pagination system being able to calculate total number of pages based on total number of events. If one page displays 5 events, and another displays 4 etc.
The user does not interact, but ideally i'll be able to display the current page number and total number of pages.
I haven't yet looked into any type of pagination, so if this is something that is better handled by the Pagination system, please let me know and I'll remove this question. I haven't been able to find anything related in my searches, other than trying to fill the remaining empty space. I'd just like to calculate it.
Note: I've previously managed this in a PHP/JS application by populating a hidden container and comparing its size to the target container's size. If it exceeds the maximum visible height, don't add the event. I was hoping there might be a simple way with Java FX, as this is difficult to integrate with the pagination system.
Cheers!
I have a program that I created for work. This program takes an uploaded file, reads it, and puts the data into a JList in the GUI. The GUI actually has two lists and the user is able to move items between the left and right list by highlighting them like usual with a JList and then hitting an arrow to move the items. The lists are multiple-interval selection.
One small addition I would like to add is some type of counter that shows the user how many items they have selected before they actually move them between lists. This would need to be dynamic so if the user holds control down and begins clicking the counter will continue to update the number of highlighted items.
As the lists are often quite large and a user might need to move an odd number of transactions between the lists (Think 300 transactions in left list and the user needs to move exactly 50) it would be beneficial to have this counter.
Can anyone think of how this could be done? I'm not sure how to add an action listener to just clicking on the items. Please also let me know if I need to elaborate any more.
Generally my question is can I create an action listener just for when a user clicks a item in a JList that updates a counter for the current selected indices? Also it would need to change when they no longer have selected an indice.
Register a ListSelectionListener with your JList.
The listener could simply query how many rows are selected and update the number in the panel to that. Perhaps use getSelectedValues().size().
http://docs.oracle.com/javase/8/docs/api/javax/swing/JList.html#addListSelectionListener-javax.swing.event.ListSelectionListener-
I am trying to filter a list that is placed into a listview through the use of 2 drop down boxes.
The first dropdown box is titled price and the second is owner.
I want to be able to select a value in one or more of these drop down boxes and then have the List view re-render with the filtered results.
The trouble is I do not know how to begin this task, would someone be so kind as to enlighten me :D
Thanks in advance!
Your best starting point is probably this example: (Source code also available on this page, ChoicePage.java is the name)
First of all, you have to use a dynamic model in your ListView that generates the list of items depending on what you had selected in the dropdown boxes.
Then the basic idea is that you add an AjaxFormComponentUpdatingBehavior to the components that control the updates (your two dropdown boxes in your case), and in the onUpdate() method of this behaviour you should add the component you want to update to that AjaxRequestTarget passed.
I have created fixed size List. If the list has one item which is bigger than the List size it self, then the item should be wrapped to multiple lines.
SWT.WRAP can't be used as it supports only Label and Text controls.
For item customization of List you need to create your own widget.
Check e.g. http://www.snip2code.com/Snippet/11489/Custom-SWT-List-Box
In this way you will have full control on the rendering of the different items
If you want to have multiple lines in labels per item in a list, then you use a table instead. See the SWT snippet "draw multiple lines in a table item" for the relevant code.
The bad news is that all items must have the same height...
I am programming in Java, using Swing.
I am currently working with an application which allows the user to display 2 or less hobbies. The list of hobbies is finite. I would like to provide a user with a list of checkboxes to select these items from, allowing them to check up to 2 options, but no more.
What are my options for implementing this? Is there a ButtonGroup like object that can hold these items?
I'm trying to avoid having 2 Combo boxes for this, as if the arbitrary 2 limit is increased (to size n) It'd be a pain to scale.
Hook up the action event of each checkbox and count how many are checked every time this handler is invoked. If as many are checked as it is allowed, disable every unchecked checkbox, else enable it.
Otherwise, just disable the submittion button and add a label explaining the situation to the user - and re-enable it as soon as the active number of checkboxes drops below the threshhold.
Consider using checkbox list (list control with checkbox next to each item). This approach scales better than producing a separate checkbox per item.