Skip to content

Commit

Permalink
Merge branch 'master' into 523
Browse files Browse the repository at this point in the history
  • Loading branch information
srbdev committed Nov 17, 2015
2 parents 55d58f8 + f133174 commit 7b3f321
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 17 deletions.
6 changes: 3 additions & 3 deletions end-to-end-tests/CCA-tests.feature
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Feature: testing CCA models

Scenario: Navigate to CCA
Scenario: Navigate to CCA Scatterplot and check bitmap image of Scatterplot
Given we can navigate to our example CCA model
when we have navigated to our example model
then we should be able to highlight rows in the table
when we have the Scatterplot load
then we should have an accurate Scatterplot
22 changes: 8 additions & 14 deletions end-to-end-tests/steps/CCA-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,12 @@ def impl(context):
context.browser.find_element(By.CSS_SELECTOR, "#slycat-projects > div > div > div > a:nth-child(2)").click()
context.browser.find_element(By.CSS_SELECTOR,
"#slycat-project > div:nth-child(1) > div > div > a:nth-child(1)").click()
context.browser.find_element(By.CSS_SELECTOR, "#table > div.slick-viewport > div > div:nth-child(2)").click()

# give the plot a sec to load
time.sleep(2)


@when('we have the Scatterplot load')
def impl(context):
# Get the canvas image
png_url = context.browser.execute_script('return document.getElementById("scatterplot").toDataURL("image/png");')

Expand All @@ -69,24 +70,17 @@ def impl(context):
str_decoded = str_base64.decode('base64')

# Write out the image somewhere
output_img = "img.png"
output_img = "test-img.png"
fp = open(output_img, 'wb')
fp.write(str_decoded)
fp.close()

time.sleep(5)
# canvas = context.browser.find_element_by_id("scatterplot")
# plot = ActionChains(context.browser).move_to_element_with_offset(canvas, -104, -80).click()
# plot.perform()
# table > div.slick-viewport > div > div.ui-widget-content.slick-row.even.active > div.slick-cell.l5.r5.rowInput.active.selected
time.sleep(2)


@when('we have navigated to our example model')
def impl(context):
assert True is not False


@then('we should be able to highlight rows in the table')
@then('we should have an accurate Scatterplot')
def impl(context):
assert are_images_equal("actual.png", "img.png", "diff.png")
assert context.failed is False
assert are_images_equal("actual-img.png", "test-img.png", "imgs-diff.png")
assert context.failed is False
Binary file added end-to-end-tests/steps/actual-img.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed end-to-end-tests/steps/actual.png
Binary file not shown.
Binary file removed end-to-end-tests/steps/img.png
Binary file not shown.
File renamed without changes
Binary file added end-to-end-tests/steps/test-img.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7b3f321

Please sign in to comment.