<commit_before>#!/usr/bin/python

# Matt's MYUW Mobile test

# What these tests will check for:
# Landing page:
# * Correct number of critical notices 
# * Correct number of unread notices 
# * Correct email link, or lack thereof
# * Presense of registration card, if expected
# * Correct link names and URLs of registration resource links
# * Correct course card titles
# * Correct visual schedule course titles
# * Correct HFS husky card names
# * Library card present if expected
# * Correct number of library holds ready, if expected
# * Correct number of checked out items, if expected
# * Correct value of library fine, if expected
# * Presense of each expected future quarter
# * Lack of error messages
# * Check "No registration found" if expected
# * Check name and URLs of resource page links
# TODO: Notices page, tuition 

import unittest
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
import selenium
import time
import sys
import os
from myuw_selenium.platforms import on_platforms, SeleniumLiveServerTestCase

# Myuw specific stuff
# Test user classes
from myuw_selenium.test.myuw_user import testUser, testUserDate
# General default settings
from myuw_selenium.test.musettings import *
# Expected data
from myuw_selenium.test.mudata import *
from myuw_selenium.test.resourcelinks import resLinks
from myuw_selenium.test.records import records
from myuw_selenium.test.academic_card import academic_card_values
from myuw_selenium.test.grade_card import grade_card_values
# Test scenario classes
from muwm_cases import myuw_user_scenario, myuw_date_scenario

# Set up a virtual display if we're on a supported system
# and the DISPLAY variable does not appear to be set. 
# Is there a better way to check if the ssytem is using X or not?
p = sys.platform

if p in ('win32', 'mac', 'darwin'):
    pass
else:
    if os.environ.get('DISPLAY'):
        pass
    else:
        import pyvirtualdisplay
        vd = pyvirtualdisplay.Display(visible = 0, size = (800, 600))
        vd.start()
            


# Mock data user scenarios

# Format for a scenario:
# @on_platforms() # Creates a copy of the test for every browser we test on
# class class_name(base_scenario, SeleniumLiveServerTestCase): 
# # base_scenario is the base test case, such as myuw_user_scenario, 
# # or myuw_date_scenario
#     def postsetup
#         self.user = testUser(self.driver, self, args...) # See myuw_user.py for docs
#         self.username = 'netidGoesHere'
#         self.setDate('yyyy-mm-dd') # Optional


@on_platforms()
class myuw_jbothell_date1(myuw_date_scenario, SeleniumLiveServerTestCase):
    def postsetup(self):
        self.user = testUser(self.driver, self, 
            critical = 4, 
            unread = 10, 
            email = emails['live'], 
            regcard = True, 
            regholds = 1, 
            reglinks = (links['bts'], links['reg']), 
            schedule = True, 
            vSchedule = True,
            courses = ('BCWRIT 500 A', 'BISSEB 259 A', 'BESS 102 A', 'BESS 102 AB'), 
            tuition = {'balance' : True, 'due' : 'future'},
            HFS = ('stu',), 
            library = True, 
            libraryholds = 1, 
            textbooks = ('BISSEB 259 A', 'BCWRIT 500', 'BESS 102 A', 'BESS 102 AB'),
            resources = resLinks['bothell'],
            record = records['jbothell'],
            academic_card = academic_card_values['jbothell']
        )
        self.username = 'jbothell'
        self.setDate('2013-04-12')
             

# jbothell user scenario
@on_platforms()
class myuw_jbothell(myuw_user_scenario, SeleniumLiveServerTestCase):
    def postsetup(self):
        self.user = testUser(self.driver, self, 
            critical = 4, 
            unread = 10, 
            email = emails['live'], 
            regcard = ['Registration: Autumn 2013'], 
            regholds = 1, 
            reglinks = (links['bts'], links['reg']), 
            schedule = True, 
            vSchedule = True,
            courses = ('BCWRIT 500 A', 'BISSEB 259 A', 'BESS 102 A', 'BESS 102 AB'), 
            tuition = {'balance' : True, 'due' : 'future'},
            HFS = ('stu',), 
            library = True, 
            libraryholds = 1, 
            textbooks = ('BISSEB 259 A', 'BCWRIT 500', 'BESS 102 A', 'BESS 102 AB'),
            resources = resLinks['bothell'],
            record = records['jbothell'],
            academic_card = academic_card_values['jbothell']
        )
        self.username = 'jbothell'
    
    def test_blah(self):
        pass<commit_msg>More test fixup<commit_after>#!/usr/bin/python

# Matt's MYUW Mobile test

# What these tests will check for:
# Landing page:
# * Correct number of critical notices 
# * Correct number of unread notices 
# * Correct email link, or lack thereof
# * Presense of registration card, if expected
# * Correct link names and URLs of registration resource links
# * Correct course card titles
# * Correct visual schedule course titles
# * Correct HFS husky card names
# * Library card present if expected
# * Correct number of library holds ready, if expected
# * Correct number of checked out items, if expected
# * Correct value of library fine, if expected
# * Presense of each expected future quarter
# * Lack of error messages
# * Check "No registration found" if expected
# * Check name and URLs of resource page links
# TODO: Notices page, tuition 

import unittest
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
import selenium
import time
import sys
import os
from myuw_selenium.platforms import on_platforms, SeleniumLiveServerTestCase

# Myuw specific stuff
# Test user classes
from myuw_selenium.test.myuw_user import testUser, testUserDate
# General default settings
from myuw_selenium.test.musettings import *
# Expected data
from myuw_selenium.test.mudata import *
from myuw_selenium.test.resourcelinks import resLinks
from myuw_selenium.test.records import records
from myuw_selenium.test.academic_card import academic_card_values
from myuw_selenium.test.grade_card import grade_card_values
# Test scenario classes
from muwm_cases import myuw_user_scenario, myuw_date_scenario

# Set up a virtual display if we're on a supported system
# and the DISPLAY variable does not appear to be set. 
# Is there a better way to check if the ssytem is using X or not?
p = sys.platform

if p in ('win32', 'mac', 'darwin'):
    pass
else:
    if os.environ.get('DISPLAY'):
        pass
    else:
        import pyvirtualdisplay
        vd = pyvirtualdisplay.Display(visible = 0, size = (800, 600))
        vd.start()
            


# Mock data user scenarios

# Format for a scenario:
# @on_platforms() # Creates a copy of the test for every browser we test on
# class class_name(base_scenario, SeleniumLiveServerTestCase): 
# # base_scenario is the base test case, such as myuw_user_scenario, 
# # or myuw_date_scenario
#     def postsetup
#         self.user = testUser(self.driver, self, args...) # See myuw_user.py for docs
#         self.username = 'netidGoesHere'
#         self.setDate('yyyy-mm-dd') # Optional


@on_platforms()
class myuw_jbothell_date1(myuw_date_scenario, SeleniumLiveServerTestCase):
    def postsetup(self):
        self.user = testUser(self.driver, self, 
            critical = 4, 
            unread = 10, 
            email = emails['live'], 
            regcard = True, 
            regholds = 1, 
            reglinks = (links['bts'], links['reg']), 
            schedule = True, 
            vSchedule = True,
            courses = ('BCWRIT 500 A', 'BISSEB 259 A', 'BESS 102 A', 'BESS 102 AB'), 
            tuition = {'balance' : True, 'due' : 'future'},
            HFS = ('stu',), 
            library = True, 
            libraryholds = 1, 
            textbooks = ('BISSEB 259 A', 'BCWRIT 500', 'BESS 102 A', 'BESS 102 AB'),
            resources = resLinks['bothell'],
            record = records['jbothell'],
            academic_card = academic_card_values['jbothell']
        )
        self.username = 'jbothell'
        self.setDate('2013-04-12')
             

# jbothell user scenario
@on_platforms()
class myuw_jbothell(myuw_user_scenario, SeleniumLiveServerTestCase):
    def postsetup(self):
        self.user = testUser(self.driver, self, 
            critical = 4, 
            unread = 10, 
            email = emails['live'], 
            regcard = ['Registration: Summer 2013'], 
            regholds = 1, 
            reglinks = (links['bts'], links['reg']), 
            schedule = True, 
            vSchedule = True,
            courses = ('BCWRIT 500 A', 'BISSEB 259 A', 'BESS 102 A', 'BESS 102 AB'), 
            tuition = {'balance' : True, 'due' : 'future'},
            HFS = ('stu',), 
            library = True, 
            libraryholds = 1, 
            textbooks = ('BISSEB 259 A', 'BCWRIT 500', 'BESS 102 A', 'BESS 102 AB'),
            resources = resLinks['bothell'],
            record = records['jbothell'],
            academic_card = academic_card_values['jbothell']
        )
        self.username = 'jbothell'
    
    def test_blah(self):
        pass
{'fraction_non_alphanumeric': 0.0945273631840796, 'fraction_numerical': 0.017304780445598095, 'mean_word_length': 2.7422096317280453, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4021524', 'n_tokens_mistral': 2949, 'n_tokens_neox': 2664, 'n_words': 889}