Commit d79b72af by Piotr Mitros

We can now autogenerate icons with bok_choi.

parent 0303537b
icons:
nosetests test_icons.py --with-save-baseline
mv screenshots/baseline/face* ../rate/public/default_icons/
This is a simple script for generating images of faces for use in the
RateXBlock.
You don't need to use this script yourself; they are committed to the
repo.
If you do want to use this, run:
pip install bok_choy
make
If you'd like to modify the icons, see the HTML file.
# -*- coding: utf-8 -*-
from bok_choy.page_object import PageObject
class IconsPage(PageObject):
"""
GitHub's search page
"""
url = 'https://rawgit.com/pmitros/RateXBlock/master/makeicons/raw_icons.html'
def is_browser_on_page(self):
return self.q(css='#face5').is_present()
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<style>
.face {
width: 60px;
text-align: center;
display:inline;
}
</style>
</head>
<bod>
<font size="7">
<div id="face1" class="face">😁</div>
<div id="face2" class="face">😊</div>
<div id="face3" class="face">😐</div>
<div id="face4" class="face">😞</div>
<div id="face5" class="face">😭</div>
</font>
</body>
'''
This is a simple program which will capture icons from an HTML
Unicode font which can be used as happy/sad faces in the XBlock. We'd
rather use real fonts, but they render very poorly under some OSes
(Hello, Apple!), and may be missing on others (Hello,
Microsoft!). This script generally does not need to be rerun, but if
you would like to, we'd recommend running this under Ubuntu.
'''
import unittest
from bok_choy.web_app_test import WebAppTest
from pages import IconsPage
class TestIcons(WebAppTest):
"""
Tests for the GitHub site.
"""
def test_page_existence(self):
"""
Make sure that the page is accessible.
"""
page = IconsPage(self.browser)
page.visit()
self.assertScreenshot("#face1", "face1")
self.assertScreenshot("#face2", "face2")
self.assertScreenshot("#face3", "face3")
self.assertScreenshot("#face4", "face4")
self.assertScreenshot("#face5", "face5")
if __name__ == '__main__':
unittest.main()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment