adini121 / mcom-tests Goto Github PK
View Code? Open in Web Editor NEWThis project forked from mozilla/mcom-tests
Tests for Mozilla's website.
Home Page: https://www.mozilla.org/
This project forked from mozilla/mcom-tests
Tests for Mozilla's website.
Home Page: https://www.mozilla.org/
From @stephendonner on January 7, 2015 17:26
Let's re-evaluate the static homepage-link tests, which it looks like (due to frequent changes) we'd have to update often, like to address this recent failure:
09:13:05 =================================== FAILURES ===================================
09:13:05 ____________ TestHomePage.test_major_link_destinations_are_correct _____________
09:13:05 [gw1] darwin -- Python 2.7.5 /Users/Shared/Jenkins/Home/jobs/mozilla.com.dev.saucelabs/workspace/.env/bin/python
09:13:05 self = <tests.test_home.TestHomePage instance at 0x102fce368>
09:13:05 mozwebqa = <pytest_mozwebqa.pytest_mozwebqa.TestSetup instance at 0x102fc3320>
09:13:05
09:13:05 @pytest.mark.nondestructive
09:13:05 def test_major_link_destinations_are_correct(self, mozwebqa):
09:13:05 home_page = HomePage(mozwebqa)
09:13:05 home_page.go_to_page()
09:13:05 bad_links = []
09:13:05 for link in home_page.major_links_list:
09:13:05 url = home_page.link_destination(link.get('locator'))
09:13:05 if not url.endswith(link.get('url_suffix')):
09:13:05 bad_links.append('%s does not end with %s' % (url, link.get('url_suffix')))
09:13:05 > Assert.equal(0, len(bad_links), '%s bad links found: ' % len(bad_links) + ', '.join(bad_links))
09:13:05
09:13:05 tests/test_home.py:36:
09:13:05 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
09:13:05
09:13:05 self = <class 'unittestzero.Assert'>, first = 0, second = 2
09:13:05 msg = u'2 bad links found: https://webmaker.org/ does not end with //sendto.mozilla....rg_largeblock, https://webmaker.org/appmaker does not end with //webmaker.org/'
09:13:05
09:13:05 @classmethod
09:13:05 def equal(self, first, second, msg=None):
09:13:05 """
09:13:05 Asserts that 2 elements are the same
09:13:05
09:13:05 :Args:
09:13:05 - First object to be tested
09:13:05 - Second object to be tested
09:13:05 - Message that will be printed if it fails
09:13:05 """
09:13:05 > assert first == second, msg
09:13:05 E AssertionError: 2 bad links found: https://webmaker.org/ does not end with //sendto.mozilla.org/page/contribute/givenow-seq?preset=2&source=mozillaorg_largeblock&ref=EOYFR2014&utm_campaign=EOYFR2014&utm_source=mozilla.org&utm_medium=referral&utm_content=mozillaorg_largeblock, https://webmaker.org/appmaker does not end with //webmaker.org/
09:13:05
09:13:05 .env/lib/python2.7/site-packages/unittestzero.py:55: AssertionError
09:13:05 ------------------------------- pytest-mozwebqa --------------------------------
09:13:05 Failing URL: https://www-dev.allizom.org/en-US/
Page object: https://github.com/mozilla/mcom-tests/blob/master/pages/desktop/home.py#L18
Test: https://github.com/mozilla/mcom-tests/blob/master/tests/test_home.py#L28
Copied from original issue: mozilla/mcom-tests#373
From @stephendonner on January 7, 2015 17:26
Let's re-evaluate the static homepage-link tests, which it looks like (due to frequent changes) we'd have to update often, like to address this recent failure:
09:13:05 =================================== FAILURES ===================================
09:13:05 ____________ TestHomePage.test_major_link_destinations_are_correct _____________
09:13:05 [gw1] darwin -- Python 2.7.5 /Users/Shared/Jenkins/Home/jobs/mozilla.com.dev.saucelabs/workspace/.env/bin/python
09:13:05 self = <tests.test_home.TestHomePage instance at 0x102fce368>
09:13:05 mozwebqa = <pytest_mozwebqa.pytest_mozwebqa.TestSetup instance at 0x102fc3320>
09:13:05
09:13:05 @pytest.mark.nondestructive
09:13:05 def test_major_link_destinations_are_correct(self, mozwebqa):
09:13:05 home_page = HomePage(mozwebqa)
09:13:05 home_page.go_to_page()
09:13:05 bad_links = []
09:13:05 for link in home_page.major_links_list:
09:13:05 url = home_page.link_destination(link.get('locator'))
09:13:05 if not url.endswith(link.get('url_suffix')):
09:13:05 bad_links.append('%s does not end with %s' % (url, link.get('url_suffix')))
09:13:05 > Assert.equal(0, len(bad_links), '%s bad links found: ' % len(bad_links) + ', '.join(bad_links))
09:13:05
09:13:05 tests/test_home.py:36:
09:13:05 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
09:13:05
09:13:05 self = <class 'unittestzero.Assert'>, first = 0, second = 2
09:13:05 msg = u'2 bad links found: https://webmaker.org/ does not end with //sendto.mozilla....rg_largeblock, https://webmaker.org/appmaker does not end with //webmaker.org/'
09:13:05
09:13:05 @classmethod
09:13:05 def equal(self, first, second, msg=None):
09:13:05 """
09:13:05 Asserts that 2 elements are the same
09:13:05
09:13:05 :Args:
09:13:05 - First object to be tested
09:13:05 - Second object to be tested
09:13:05 - Message that will be printed if it fails
09:13:05 """
09:13:05 > assert first == second, msg
09:13:05 E AssertionError: 2 bad links found: https://webmaker.org/ does not end with //sendto.mozilla.org/page/contribute/givenow-seq?preset=2&source=mozillaorg_largeblock&ref=EOYFR2014&utm_campaign=EOYFR2014&utm_source=mozilla.org&utm_medium=referral&utm_content=mozillaorg_largeblock, https://webmaker.org/appmaker does not end with //webmaker.org/
09:13:05
09:13:05 .env/lib/python2.7/site-packages/unittestzero.py:55: AssertionError
09:13:05 ------------------------------- pytest-mozwebqa --------------------------------
09:13:05 Failing URL: https://www-dev.allizom.org/en-US/
Page object: https://github.com/mozilla/mcom-tests/blob/master/pages/desktop/home.py#L18
Test: https://github.com/mozilla/mcom-tests/blob/master/tests/test_home.py#L28
Copied from original issue: mozilla/mcom-tests#373
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.