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

Spw grid view2 #4924

Merged
merged 42 commits into from
Jan 8, 2017
Merged
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
503931d
Add 'position' data to WellImages_json
will-moore Oct 19, 2016
8be63de
Move scripts from plate.html to base_container - remove duplicates
will-moore Oct 26, 2016
7bf5a41
Move functions from plate.html to spwgridview.js
will-moore Oct 26, 2016
e344a45
Basic display of images in well bird's eye view
will-moore Oct 27, 2016
c66cd64
Sync selection of images in well birds eye
will-moore Oct 27, 2016
b2aebd1
Improving Well birds eye view
will-moore Nov 2, 2016
e7b7931
More fixes and tweaks to well_birds_eye
will-moore Nov 3, 2016
81ced05
Hide well_birds_eye on click X
will-moore Nov 3, 2016
f76910f
Fix height of center panel .tableLayout
will-moore Nov 4, 2016
f5aea1e
Move styles from plate.html to layout.css
will-moore Nov 4, 2016
93fd99e
Adding 'Wrap x images per row' functionality
will-moore Nov 4, 2016
8c71a61
Robot setup populates posX and posY on WellSamples
will-moore Nov 4, 2016
a134fa3
Fix PYTHONPATH for wellSample posXY script in robot_setup.sh
will-moore Nov 7, 2016
6232966
Robot tests grid layout of well-images
will-moore Nov 7, 2016
abc5d85
robot test typo fix
will-moore Nov 7, 2016
7ef9233
robot_setup passes 'host' and 'port' to BlitzGateway in wsScript.py
will-moore Nov 10, 2016
7518e2a
Increase select highlight width around well images
will-moore Nov 14, 2016
b08bcce
Handle ?show=image-1 to select well and image
will-moore Nov 14, 2016
b92a649
Add test of listwellimages json with posX & posY
will-moore Nov 14, 2016
0929ac9
Adding to robot 'Test Spw Grid Layout' test
will-moore Nov 15, 2016
b5c4988
Fix ?show=well-1 showing Well in right panel
will-moore Nov 15, 2016
90d3124
flake8 fix
will-moore Nov 15, 2016
5335598
Robot test for 'Show Well Images'
will-moore Nov 15, 2016
c1e8c64
Added new robot 'Test Spw Spacial Birds Eye'
will-moore Nov 15, 2016
1ceebdc
Filter listWellImages by 'run'
will-moore Nov 18, 2016
46b0b1b
Pass acquisition/run to listWellImages url
will-moore Nov 18, 2016
80377b6
Robot tests plate has 2 acquisitions
will-moore Nov 18, 2016
9b30c26
Fix xPos, yPos -> x_pos, y_pos in test_plategrid.py
will-moore Nov 24, 2016
2c202ba
Typo fixes
will-moore Nov 24, 2016
05915ac
Don't try to 'show' multiple Wells in show._initially_select
will-moore Dec 2, 2016
51f58be
Revert "Don't try to 'show' multiple Wells in show._initially_select"
will-moore Dec 2, 2016
18b17f6
Use both show.initially_open and show.initially_select
will-moore Dec 2, 2016
acf7400
Fix robot test
will-moore Dec 2, 2016
570e2d7
When ?show=well-1 only show Well when plate first loaded
will-moore Dec 2, 2016
7fdbe52
Merge remote-tracking branch 'origin/develop' into spw_grid_view2
will-moore Dec 5, 2016
9d506e6
Moving robot_setup.sh wsScript.py -> well_sample_posXY.py
will-moore Dec 14, 2016
162890d
Add Usage docstring to well_sample_posXY.py
will-moore Dec 14, 2016
338cac4
Typo fixes
will-moore Dec 14, 2016
e0cd29a
Change path to script.
jburel Dec 19, 2016
c0eb788
Merge pull request #55 from jburel/spw_grid_view2
Dec 19, 2016
fce8a2e
Remove extra ")"
jburel Dec 20, 2016
901733d
Merge pull request #56 from jburel/spw_grid_view2
Dec 20, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 18 additions & 12 deletions components/tests/ui/resources/web/tree.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,6 @@ Select And Expand Project Dataset Image
${imageId}= Select First Image
[Return] ${projectId} ${datasetId} ${imageId}

Select And Expand Plate
${firstNodeId} Select First Node By Type plate
[Return] ${firstNodeId}

Select And Expand Run
${firstNodeId} Select First Node By Type acquisition
[Return] ${firstNodeId}

Select And Expand Image
${pid} ${did} ${imageId} Select And Expand Project Dataset Image
[Return] ${imageId}
Expand Down Expand Up @@ -232,6 +224,13 @@ Select First Image With Name
Wait For General Panel Image
[Return] ${nodeId}

Select First Plate With Name
[Arguments] ${PlateName}
${nodeId}= Wait For Plate Node Text ${PlateName}
Click Node ${nodeId}
Wait For General Panel Plate
[Return] ${nodeId}

Select First Orphaned Image
${nodeId} Select Orphaned Images Section
Wait Until Element Is Visible xpath=//li[@id='${nodeId}']/ul/li[1]/a
Expand Down Expand Up @@ -313,8 +312,8 @@ Wait Until Center Panel Loads
Run Keyword If '${containerType}' == 'Dataset' Wait Until Element Is Visible //*[@id="content_details"]/div[1]
Run Keyword If '${containerType}' == 'Dataset' Wait Until Element Is Visible xpath=//*[@id="filtersearch"]/div/label[contains(text(),'Filter Images')]
Run Keyword If '${containerType}' == 'Dataset' Wait Until Element Is Visible xpath=//*[@id="icon_layout"][contains(@title,"View as Thumbnails")][contains(@class,"checked")]
Run Keyword If '${containerType}' == 'Dataset' Wait Until Element Is Visible //*[@id="table_layout"][contains(@title,"View as List")]
Run Keyword If '${containerType}' == 'Dataset' Wait Until Element Is Visible //*[@id="table_layout"][contains(@title,"View as List")]


# Methods for querying nodes by TEXT

Expand Down Expand Up @@ -406,7 +405,7 @@ Image Should Not Exist In Tree
[Arguments] ${imageId}
Node Should Not Exist In Tree ${imageIcon} ${imageId}

Dataset Should Contain Image
Dataset Should Contain Image
[Arguments] ${imageId} ${datasetId}
Select Dataset By Id ${datasetId}
Wait Until Page Contains Element css=tr.data_heading_id strong
Expand Down Expand Up @@ -539,6 +538,13 @@ Click Next Thumbnail
Click Next Well
Click Element xpath=//td[contains(@class, 'well')][contains(@class, 'ui-selected')]/following-sibling::td/img

Click Well By Name
[Arguments] ${name}
Wait Until Page Contains Element xpath=//td[contains(@class,'well')]/img[@name='${name}']
# Have to be sure that thumbnail itself has loaded before image is clickable!
Sleep 1
Click Element xpath=//td[contains(@class,'well')]/img[@name='${name}']


Thumbnail Should Be Selected
[Arguments] ${imageId} ${expected}=${true}
Expand All @@ -565,7 +571,7 @@ Meta Click Node
[Arguments] ${nodeId}
Meta Click Element "#${nodeId}>a"

Meta Click Thumbnail
Meta Click Thumbnail
[Arguments] ${iid}
Meta Click Element "#image_icon-${iid}"

Expand Down
35 changes: 35 additions & 0 deletions components/tests/ui/resources/well_sample_posXY.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@

"""
Script used by robot_setup.py to set posX and posY on Well Samples.

Usage:
$ python well_sample_posXY.py host port sessionKey plateId

Used after import of SPW data to provide spatial settings on well
samples. Tested by spw_test.
"""

import argparse
import omero
from omero.gateway import BlitzGateway
from omero.model.enums import UnitsLength
parser = argparse.ArgumentParser()
parser.add_argument('host', help='OMERO host')
parser.add_argument('port', help='OMERO port')
parser.add_argument('key', help='OMERO session key')
parser.add_argument('plateId', help='Plate ID to process', type=int)
args = parser.parse_args()
conn = BlitzGateway(host=args.host, port=args.port)
conn.connect(args.key)
update = conn.getUpdateService()
plate = conn.getObject('Plate', args.plateId)
r = UnitsLength.REFERENCEFRAME
cols = 3
for well in plate.listChildren():
for i, ws in enumerate(well.listChildren()):
x = i % cols
y = i / cols
ws = conn.getQueryService().get('WellSample', ws.id)
ws.posY = omero.model.LengthI(y, r)
ws.posX = omero.model.LengthI(x, r)
update.saveObject(ws)
22 changes: 16 additions & 6 deletions components/tests/ui/robot_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ CONFIG_FILENAME=${CONFIG_FILENAME:-robot_ice.config}
IMAGE_NAME=${IMAGE_NAME:-test&acquisitionDate=2012-01-01_00-00-00&sizeZ=3&sizeT=10.fake}
TINY_IMAGE_NAME=${TINY_IMAGE_NAME:-test&acquisitionDate=2012-01-01_00-00-00.fake}
MIF_IMAGE_NAME=${MIF_IMAGE_NAME:-test&series=3.fake}
PLATE_NAME=${PLATE_NAME:-test&plates=1&plateAcqs=1&plateRows=2&plateCols=3&fields=1&screens=0.fake}
PLATE_NAME=${PLATE_NAME:-test&plates=1&plateAcqs=2&plateRows=2&plateCols=3&fields=5&screens=0.fake}
TINY_PLATE_NAME=${TINY_PLATE_NAME:-test&plates=1&plateAcqs=1&plateRows=1&plateCols=1&fields=1&screens=0.fake}
BULK_ANNOTATION_CSV=${BULK_ANNOTATION_CSV:-bulk_annotation.csv}
FILE_ANNOTATION=${FILE_ANNOTATION:-robot_file_annotation.txt}

Expand All @@ -35,8 +36,13 @@ bin/omero logout
touch $IMAGE_NAME
touch $TINY_IMAGE_NAME
touch $PLATE_NAME
touch $TINY_PLATE_NAME
touch $MIF_IMAGE_NAME

# Python script for setting posX and posY on wellsamples
# Used below after importing a plate
WELLSCRIPT="../components/tests/ui/resources/well_sample_posXY.py"

# Create batch annotation csv
echo "Well,Well Type,Concentration" > "$BULK_ANNOTATION_CSV"
echo "A1,Control,0" >> "$BULK_ANNOTATION_CSV"
Expand Down Expand Up @@ -83,16 +89,20 @@ do
bin/omero import -d $mifDs $MIF_IMAGE_NAME --debug ERROR
done

# Import Plate
# Import Plate and rename
bin/omero import $PLATE_NAME --debug ERROR > plate_import.log 2>&1
plateid=$(sed -n -e 's/^Plate://p' plate_import.log)
bin/omero obj update Plate:$plateid name=spwTests
# Use populate_metadata to upload and attach bulk annotation csv
OMERO_DEV_PLUGINS=1 bin/omero metadata populate Plate:$plateid --file $BULK_ANNOTATION_CSV

# Import Plate and rename for test ?show=image.name-NAME
bin/omero import $PLATE_NAME --debug ERROR > show_import.log 2>&1
# Run script to populate WellSamples with posX and posY values
PYTHONPATH=./lib/python python $WELLSCRIPT $HOSTNAME $PORT $key $plateid

# Import Tiny Plate (single acquisition & well) and rename
bin/omero import $TINY_PLATE_NAME --debug ERROR > show_import.log 2>&1
plateid=$(sed -n -e 's/^Plate://p' show_import.log)
bin/omero obj update Plate:$plateid name=testShowPlate
bin/omero obj update Plate:$plateid name=tinyPlate
# Import Image into Project/Dataset and rename for test
showP=$(bin/omero obj new Project name='showProject')
showD=$(bin/omero obj new Dataset name='showDataset')
Expand All @@ -108,7 +118,7 @@ done
scrDs=$(bin/omero obj new Screen name='CreateScenario')
for (( k=1; k<=6; k++ ))
do
bin/omero import -r $scrDs $PLATE_NAME --debug ERROR
bin/omero import -r $scrDs $TINY_PLATE_NAME --debug ERROR
done

# Create Orphaned Images for Create Scenario
Expand Down
33 changes: 29 additions & 4 deletions components/tests/ui/testcases/web/show_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ Suite Teardown Close all browsers

${imageName1} testShowImage1
${imageName2} testShowImage2
${plateName} testShowPlate
${plateName} spwTests
${FIELD_COUNT} 5
# Full Well name may make test fragile?
${wellName} test&plates=1&plateAcqs=1&plateRows=2&plateCols=3&fields=1&screens=0.fake [test]
${runName} PlateAcquisition Name 0
Expand All @@ -24,7 +25,7 @@ Wait For Right Panel
Wait Until Page Contains Element xpath=//tr[contains(@class,'data_heading_id')]//th[contains(text(),'${dataType} ID:')]
Wait Until Page Contains Element xpath=//div[contains(@class,'data_heading')]//*[contains(text(),'${dataName}')]
${dataId}= Get Text css=tr.data_heading_id strong
[Return] ${dataId}
[Return] ${dataId}

Check Well Selected
[Arguments] ${wellName} ${wellId}
Expand All @@ -42,7 +43,7 @@ Test Show Plate
[Documentation] Tests that ?show functionality works on pre-imported Plates

# Load the Plate by show
Go To ${WELCOME URL}?show=plate.name-testShowPlate
Go To ${WELCOME URL}?show=plate.name-${plateName}
${plateId}= Wait For Right Panel Plate ${plateName}
${nodeId}= Plate Should Be Selected By Name ${plateName}
# Check URL from the Link button
Expand All @@ -57,7 +58,7 @@ Test Show Plate
# Check URL from the Link button
${wellUrl}= Get Link Button Url
Should Be Equal ${wellUrl} ${WELCOME URL}?show=well-${wellId}

# Get Next Well IDs to Test multi-selection of Wells
${well-id-A2}= Get Element Attribute xpath=//td[contains(@class, 'well')][descendant::img[@name='A2']]@id
${w} ${wellA2Id}= Split String ${well-id-A2} -
Expand All @@ -78,6 +79,30 @@ Test Show Plate
${nodeId}= Wait For Plate Node Text ${plateName}
Node Should Be Selected By Id ${nodeId}

Test Show Well Images
[Documentation] Tests Show of multiple images in a Well

Select Experimenter
Select First Plate With Name ${plateName}
Select First Run
Click Well By Name A1

# Images from a single Well shown in bottom panel
Wait Until Page Contains Element xpath=//div[@id='wellImages']//li/img
Xpath Should Match X Times //div[@id='wellImages']//li/img ${FIELD_COUNT}

# Select Range: Shift-click 5th image
Click Element xpath=//div[@id='wellImages']//li/img[1]
Shift Click Element "#wellImages img:eq(4)"
Wait Until Page Contains Element //h1[@id='batch_ann_title']/span[contains(text(), '5 objects')]

# Use 'Link' button to get link
Click Element id=show_link_btn
${imagesUrl}= Get Element Attribute id=link_info_popup_string@value
Go To ${imagesUrl}
Wait Until Page Contains Element //h1[@id='batch_ann_title']/span[contains(text(), '5 objects')]
Xpath Should Match X Times //div[@id='wellImages']//li/img ${FIELD_COUNT}


Test Show PDI
[Documentation] Tests that ?show functionality works on Images in Project/Dataset
Expand Down
106 changes: 97 additions & 9 deletions components/tests/ui/testcases/web/spw_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ Suite Setup Run Keywords User "${USERNAME}" logs in with password "${PA
Suite Teardown Close all browsers


*** Keywords ***
*** Variables ***
# robot_setup script has created data with these parameters
${PLATE_NAME} spwTests
${TINY_PLATE_NAME} tinyPlate
${FIELD_COUNT} 5
${FIELD_COUNT3} 15


Click Well By Name
[Arguments] ${name}
Wait Until Page Contains Element xpath=//td[contains(@class,'well')]/img[@name='${name}']
# Have to be sure that thumbnail itself has loaded before image is clickable!
Sleep 1
Click Element xpath=//td[contains(@class,'well')]/img[@name='${name}']
*** Keywords ***

Bulk Annotation Should Contain Row
[Arguments] ${key} ${value}
Expand All @@ -26,16 +27,103 @@ Bulk Annotation Should Contain Row

Test Auto Load Single Run
[Documentation] Selecting Plate with single Run should load plate
Select Experimenter
Select First Plate With Name ${TINY_PLATE_NAME}
# Plate should auto-load, allowing click on Well
Click Well By Name A1


Test Spw Grid Layout
[Documentation] Test loading of Well Images in bottom panel

Select Experimenter
Select First Plate With Name ${PLATE_NAME}
Select First Run
Click Well By Name A1
Wait For General Panel And Return Id Well
# Right panel should show Well
Page Should Contain Element xpath=//div[contains(@class,'data_heading')]/h1[contains(text(), 'A1')]

# Images from a single Well shown in bottom panel
Wait Until Page Contains Element xpath=//div[@id='wellImages']//li/img
Xpath Should Match X Times //div[@id='wellImages']//li/img ${FIELD_COUNT}

# Shift-Click to select 3 Wells - All images shown in bottom panel
Shift Click Element "img[name='A3']"
Wait Until Keyword Succeeds ${TIMEOUT} ${INTERVAL} Xpath Should Match X Times //div[@id='wellImages']//li/img ${FIELD_COUNT3}
# Right Panel - batch annotate 3 Wells
Wait Until Page Contains Element //h1[@id='batch_ann_title']/span[contains(text(), '3 objects')]

# No Well-Images selected. Click to select
Page Should Not Contain Element xpath=//div[@id='wellImages']//li[contains(@class,'ui-selected')]
Click Element xpath=//div[@id='wellImages']//li/img[1]
Page Should Contain Element xpath=//div[@id='wellImages']//li[1][contains(@class,'ui-selected')]
Wait For General Panel And Return Id Image

# Wrap rows of images by fixed column count
Input Text id=imagesPerRow 2
Press Key id=imagesPerRow \\13 # ASCII code for enter key
# First, Third and Fifth images should be aligned
${well1x}= Get Horizontal Position xpath=//div[@id='wellImages']//li[1]/img
${well3x}= Get Horizontal Position xpath=//div[@id='wellImages']//li[3]/img
${well5x}= Get Horizontal Position xpath=//div[@id='wellImages']//li[5]/img
Should Be Equal ${well1x} ${well3x}
Should Be Equal ${well1x} ${well5x}


Test Spw Spatial Birds Eye
[Documentation] Tests layout and clicking of 'spacial bird's eye' panel
Copy link
Member

Choose a reason for hiding this comment

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

one more spacial 'spacial bird's


Select Experimenter
Select First Plate
Select First Plate With Name ${PLATE_NAME}
Select First Run
Click Well By Name A1

# Birds eye panel shows all images/fields
Wait Until Page Contains Element xpath=//div[@id='well_birds_eye']//img
Xpath Should Match X Times //div[@id='well_birds_eye']//img ${FIELD_COUNT}

# Spatial layout: x and y
${well1x}= Get Horizontal Position xpath=//div[@id='well_birds_eye']//img[1]
${well2x}= Get Horizontal Position xpath=//div[@id='well_birds_eye']//img[2]
${well3x}= Get Horizontal Position xpath=//div[@id='well_birds_eye']//img[3]
${well4x}= Get Horizontal Position xpath=//div[@id='well_birds_eye']//img[4]
${well1y}= Get Vertical Position xpath=//div[@id='well_birds_eye']//img[1]
${well2y}= Get Vertical Position xpath=//div[@id='well_birds_eye']//img[2]
${well4y}= Get Vertical Position xpath=//div[@id='well_birds_eye']//img[4]
# First and 4th images should be aligned left (Not 2nd image)
Log ${well1x}
Log ${well2x}
Log ${well3x}
Log ${well4x}
Should Not Be Equal ${well1x} ${well2x}
Should Be Equal ${well1x} ${well4x}
# First and 2nd images should be aligned left (Not 4th image)
Should Not Be Equal ${well1y} ${well4y}
Should Be Equal ${well1y} ${well2y}

# Click image in birds eye - should select in wellImages bottom panel
Page Should Not Contain Element xpath=//div[@id='wellImages']//li[contains(@class,'ui-selected')]
Click Element xpath=//div[@id='well_birds_eye']//img[1]
Page Should Contain Element xpath=//div[@id='wellImages']//li[1][contains(@class,'ui-selected')]
Wait For General Panel And Return Id Image

# Meta Click to select additional images
Meta Click Element "#well_birds_eye img:eq(2)"
Wait Until Page Contains Element //h1[@id='batch_ann_title']/span[contains(text(), '2 objects')]
Xpath Should Match X Times //div[@id='wellImages']//li[contains(@class,'ui-selected')] 2

# Shift-Click range in wellImages panel - updates selection in 'birds eye'
Shift Click Element "#wellImages img:eq(4)"
Wait Until Page Contains Element //h1[@id='batch_ann_title']/span[contains(text(), '5 objects')]
Xpath Should Match X Times //div[@id='well_birds_eye']//img[contains(@class,'ui-selected')] 5


Test Bulk Annotations
[Documentation] Test display of bulk annotations added in setup

Select Experimenter
Select First Plate
Select First Plate With Name ${PLATE_NAME}
Select First Run
Click Well By Name A1
Wait Until Page Contains Element xpath=//h1[@data-name='tables']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,7 @@ button::-moz-focus-inner {



#search input[type=text], .filtersearch input[type=text] {
#search input[type=text], .filtersearch input[type=text], #imagesPerRow {
-webkit-border-radius:50px;
-moz-border-radius:50px;
border-radius:50px;
Expand Down