Showing posts with label Melange. Show all posts
Showing posts with label Melange. Show all posts

Tuesday, June 5, 2012

Melange Functional Testing

This week i worked on completing all the three test test scripts and making changes to base module melange_functional_actions.py. I sent my first patch to melange this week. All the test scripts import this base module and use it in writing functional tests. I am waiting for the base module to get committed so that i can start sending test scripts. I am making changes continuously to the base module adding more and more functionality to it so that test scripts look more clean. I have completed three test cases till now. One such test case is TC01 student_registration_test_tc01.py where we are checking the student registration process, when a student enters all the correct details and successfully register himself/herself on melange. Test Case , Steps to Execute, Check Item, Test Case Objective and Expected result are shown below.



Test data for all the test cases will be imported from the sheets of testdata_melange.xls workbook.
 
Here TC01 sheet contains the data for Test Case with id TC01, similarly TC02 and TC03 sheets contains test data for TC02 and TC03 test cases. The details of TC02 and TC03 will be filled in functional test cases spread sheet. The code for other two test scripts can be seen here.
Apart from this i made changes to the names of different methods in Base Module and added a couple of more methods to it.

Monday, May 28, 2012

Melange Functional Testing- Base Module & Test data

Hello everyone, This week i mainly focused on creating a base module Melange_functional_actions.py for the framework. In the base module i defined a base class funcTests which consists of many other methods which will will be used in creating test scripts for different scenarios. e.g:
  1. get_parameters(name_of_workbook)
  2. write_text_field()
  3. wait()
  4. toggle_checkbox()
  5. set_dropdown_list()
  6. wait_and_check_if_displayed()
  7. wait_and_click()
  8. wait_and_enter_text()
  9. wait_and_clear_field()
  10. assert_error()
  11. assert_link()
  12. click_on()
  13. assert_text()
  14. take_screenshot()
  15. clear_field_and_enter_new_data()
  16. setUp()
  17. tearDown()
  18. login()

I am using these methods to re write the test script for Student Registration Test . Student Registration Test has three test cases.

TC01 checks the normal path of registration.
TC02 checks for error messages when empty form is submitted.
TC03 checks for messages when wrong inputs are supplied to registration form, It assert all the messages and provide correct form data for successful registration.

Test data for the test script is here.

Sunday, May 20, 2012

Melange Functional Testing


Hi everyone, my name is Syed Armani. This summer i will be working with Melange community as a student  under Google Summer of Code.

I am  very happy that i am working with melange community this summer. Its a pleasure to work with people like Chong Liu, Sverre, Lennard, Madhu, Mario and many others. Madhu is a very nice person and Lennard is always there when you need help. Leo is a great guy and i am thankful to him that he chose me for this project. Till now i have not got enough chance to speak with other members of the community, i hope to meet them soon and  I really love the cool t-shirts that Sverre and Lennard wear in G+ Hangouts.

This summer i will be working on creating a  Data Driven Framework for Functional Testing of  Melange. A test suite consisting of all the possible test cases covering all the possible scenarios of using melange application. Test scripts for executing the test cases will be written in python and executed using Selenium Webdriver. The proposed test suite of functional tests will consist of Test cases and test data, User actions and assertions in Python, Data parametrization, Headless (xvfb) mode , Screenshots on errors.

I will write test scripts for various scenarios as "user stories".  A story depicting how a user interact with GSoC and GCI apps. We will use xlrd module to read the cells of excel sheet, these cells will contain the unique identity of the objects present in the application as well as there values, The values will be taken from the cells and they will be used to fill the forms. Assert statements will check the presence of various error messages, headings, title and text present on the pages.  Test output can be displayed to the console or saved as an HTML report. If any of the test fails a screen shot will be taken on failure to see where the test failed.

Functional test cases will be included for both GSoC & GCI applications:

GSoC:  Melange Home Page, Student Registration Page, Mentor Registration Page, Login Page, My Profile Page, My Dashboard Page, About Page, Events and Timeline Page, Connect With Us Page, Search Page, FAQ page.

GCI:  Home Page, My Dashboard, Register As Student, Events and Timeline,  The official Leader board, Tasks Page, Login, Invites to me

Monday, July 13, 2009

Sixth/Seventh Week Status Update

It appears as though there are now some diffs about which week we're on! Depends on whether we're indexing from 0 or 1?

This week I find myself working on two different tasks with a very similar theme.

The first task is in the News Feed module. When we generate a feed item, we're doing it on the logic side. the onCreate, onUpdate, and onDelete hooks that are used to create the feed item is in the model logic layer, and the feed item process itself (now being converted to a scheduled Task) is also in the logic layer.

However, the payload for a certain feed item requires access to view params in many cases so that model-specific payload templates can be re-used to render the payload for the activity item.

And you could say, "yes logic can't retrieve from view, but isn't the view retrieving from the logic anyways?" This is true, and this is why normally this is not a problem. But the problem arises when the view for one model type (site) wants to access view params for another model type (document, or survey).

This is also a challenge for the view for org admins to view the results from the manage a student project page. In this situation, the view model is for StudentProject, but the most obviously DRY approach would be to also instantiate a view class for survey view models so that we could render a list of ProjectSurveys or GradingProjectSurveys.

Short version: the view layer seems somewhat impenetrable from the logic layer, as it is tied up in the HTTP request. As a view should be. But what do we do about these edge cases?

I've been impressed with the orthognalness (is that a word?) of Melange, so it's entirely possible that I haven't yet figured out how to properly instantiate a view from the logic -- or why I don't want to do that in the first place.


On an unrelated note, another good learning experience has been in how I've been thinking about privacy in regard to how news feed activity can be consumed. While at first I was mostly alright with the idea of generating a hash key for hard-to-guess URLs. But the news feed activity is mostly HTML, content, and key words. In other words, if we're not careful, it could very easily end up crossing paths with a robot (edit: not if we set our robots.txt correctly!).