Пример #1
0
 def test_exampleGuestBook(self):
     server_url = self.zope_url
     self.get("%s/Examples/GuestBook" % server_url)
     server_url = self.zope_url
     self.setBasicAuth(self.admin_id, self.admin_pwd)
     lipsum = Lipsum()
     self.get("%s/Examples/GuestBook/addEntry.html" % server_url)
     params = [["guest_name", lipsum.getWord().capitalize()],
               ["comments", lipsum.getParagraph()]]
     self.post("%s/Examples/GuestBook/addEntry" % server_url, params)
     self.clearBasicAuth()
class VideoGranulateBench(FunkLoadTestCase):
    """This test use a configuration file Simple.conf."""

    def __init__(self, *args, **kwargs):
        FunkLoadTestCase.__init__(self, *args, **kwargs)
        """Setting up the benchmark cycle."""
        self.server_url = self.conf_get('main', 'url')
        self.sam = Restfulie.at('http://localhost:8888/').auth('test', 'test').as_('application/json')
        self.lipsum = Lipsum()
        self.uid_list = []
        self.video_file = b64encode(open(join(FOLDER_PATH, 'input', 'working_google.flv')).read())

    def test_granulate(self):
        server_url = self.server_url
        self.setBasicAuth('test', 'test')

        # The description should be set in the configuration file
        filename = self.lipsum.getUniqWord() + ".flv"

        body = dumps({'video': self.video_file, 'filename':filename})

        # begin of test ---------------------------------------------
        self.post(server_url, description='Send many videos with 5mb each.',
                  params=Data('application/json', body))
        response = loads(self.getBody())
        self.uid_list.extend(response.values())
        # end of test -----------------------------------------------

    def tearDown(self):
        for uid in self.uid_list:
            self.sam.delete(key=uid)
 def setUp(self):
     """Setting up test."""
     self.logd("setUp")
     self.server_url = self.conf_get('main', 'url')
     self.users_list = open(os.path.dirname(os.path.dirname(__file__)) + '/profiles/contentcreation/users_list.txt', 'r').readlines()
     self.user_id = random.choice(self.users_list).strip()         
     self.lipsum = Lipsum(vocab=V_ASCII, chars=CHARS, sep=SEP)
 def __init__(self, *args, **kwargs):
     FunkLoadTestCase.__init__(self, *args, **kwargs)
     """Setting up the benchmark cycle."""
     self.server_url = self.conf_get('main', 'url')
     self.sam = Restfulie.at('http://localhost:8888/').auth('test', 'test').as_('application/json')
     self.lipsum = Lipsum()
     self.uid_list = []
     self.video_file = b64encode(open(join(FOLDER_PATH, 'input', 'working_google.flv')).read())
Пример #5
0
    def cmfCreateNews(self, parent_url):
        # return the doc_url
        lipsum = Lipsum()
        doc_id = lipsum.getUniqWord().lower()
        params = [["type_name", "News Item"],
                  ["id", doc_id],
                  ["add", "Add"]]
        self.post("%s/folder_factories" % parent_url, params,
                  description="Create an empty news")
        params = [["allow_discussion", "default"],
                  ["title", lipsum.getSubject()],
                  ["description:text", lipsum.getParagraph()],
                  ["subject:lines", lipsum.getWord()],
                  ["format", "text/plain"],
                  ["change_and_view", "Change and View"]]
        doc_url = "%s/%s" % (parent_url, doc_id)
        self.post("%s/metadata_edit_form" % doc_url, params,
                  description="Set metadata")
        self.assert_('Metadata changed.' in self.getBody())

        params = [["text_format", "plain"],
                  ["description:text", lipsum.getParagraph()],
                  ["text:text", lipsum.getMessage()],
                  ["change_and_view", "Change and View"]]
        self.post("%s/newsitem_edit_form" % doc_url, params,
                  description="Set news content")
        self.assert_('News Item changed.' in self.getBody())
        return doc_url
Пример #6
0
    def setUp(self):
        """Setting up test."""
        self.server_url = self.conf_get('main', 'url')
        
        credential_host = self.conf_get('credential', 'host')
        credential_port = self.conf_getInt('credential', 'port')
        self.username, self.pwd = xmlrpc_get_credential(
            credential_host, credential_port, "group1")

        self.lipsum = Lipsum()
Пример #7
0
class ConfDBScaling(FunkLoadTestCase):
    """This test use a configuration file Conf.conf."""

    def setUp(self):
        """Setting up test."""
        self.server_url = self.conf_get('main', 'url')
        
        credential_host = self.conf_get('credential', 'host')
        credential_port = self.conf_getInt('credential', 'port')
        self.username, self.pwd = xmlrpc_get_credential(
            credential_host, credential_port, "group1")

        self.lipsum = Lipsum()

    def tearDown(self):
        self.logout()

    def login(self, page="/index"):
        # The description should be set in the configuration file
        server_url = self.server_url

        reply = self.get(server_url + "/index",
            description="Get index")

        csrftoken = extract_token(self.getBody(), "name='csrfmiddlewaretoken' value='", "' />")
        self.post(server_url + "/accounts/login/?next=" + page,
            params=[['csrfmiddlewaretoken', csrftoken],
            ['redirect_to', page],
            ['username', self.username],
            ['password', self.pwd]],
            description="Post /accounts/login/")

    def logout(self):
        self.get(self.server_url + "/accounts/logout/",
                    description="Get /accounts/logout/")

    def test_show_all_papers(self):
        page = "/index"
        self.login(page)
        self.assert_(page == self.getLastUrl(), "Error in login")
        reply = self.get(self.server_url + page, description="Get papers")
        self.logout()

    def test_show_all_users(self):
        page = "/users"
        self.login(page)
        self.assert_(page == self.getLastUrl(), "Error in login")
        reply = self.get(self.server_url + page, description="Get papers")
        self.logout()

    def test_view_paper(self):
        page = "/paper?id=1" #EnGM55IPia7nBrhBHuDqSbeG6nDghG8l"
        self.login(page)
        reply = self.get(self.server_url + page, description = "Get paper")
        self.assert_("paper" in self.getLastUrl(), "Error in showing paper")
        self.logout()

    # TODO: Submit a paper.
    def test_submit_paper(self):
        page = "/submit"
        self.login(page)
        self.assert_(page == self.getLastUrl(), "Error in login")

        num_papers = self.conf_getInt('test_submit_paper', 'num_papers')
        for i in range(num_papers):
            csrftoken = extract_token(self.getBody(), "name='csrfmiddlewaretoken' value='", "' />")
            self.post(self.server_url + "/submit",
                params=[['csrfmiddlewaretoken', csrftoken],
                ['coauthors[]', self.lipsum.getWord()],
                ['coauthors[]', self.lipsum.getWord()], 
                ['title', self.lipsum.getSentence()],
                ['contents', Upload('files/rms_crossstitch.pdf')],
                ['abstract', self.lipsum.getMessage()]],
                description="Post /accounts/login/")
            self.assert_("paper" in self.getLastUrl(), "Error in login")

    # TODO: View profile.
    def test_view_profile(self):
        page = "/accounts/profile/"
        self.login(page)
        self.assert_(page == self.getLastUrl(), "Error in login")
Пример #8
0
 def setUp(self):
     """Setting up test."""
     self.server_url = self.conf_get('main', 'url')
     self.lipsum = Lipsum()
Пример #9
0
class Hipaa(FunkLoadTestCase):
    """This test use a configuration file Conf.conf."""

    def setUp(self):
        """Setting up test."""
        self.server_url = self.conf_get('main', 'url')
        self.lipsum = Lipsum()

    def login_as(self, username, password, pageURL="/index", descr="Get index"):
        # The description should be set in the configuration file
        server_url = self.server_url

        reply = self.get(server_url + "/index",
            description="Get index")

        csrftoken = extract_token(self.getBody(), "name='csrfmiddlewaretoken' value='", "' />")
        self.post(server_url + "/accounts/login/?next=" + pageURL,
            params=[['csrfmiddlewaretoken', csrftoken],
            ['redirect_to', pageURL],
            ['username', username],
            ['password', password]],
            description="Post /accounts/login/")

    def logout(self):
        self.get(self.server_url + "/accounts/logout/",
                    description="Get /accounts/logout/")

    def test_simple(self):
        # The description should be set in the configuration file
        server_url = self.server_url
        # begin of test ---------------------------------------------
        nb_time = self.conf_getInt('test_simple', 'nb_time')
        for i in range(nb_time):
            self.get(server_url, description='Get url')
        # end of test -----------------------------------------------

    def test_login(self):
        page="/index"
        self.login_as("admin", "admin")
        reply = self.get(self.server_url + page, description="Get index")
        self.logout()

    def test_register(self):
        self.logout()

        num_users = self.conf_getInt('test_register', 'num_users')
        for i in range(num_users):
            username = self.lipsum.getUniqWord()
            password = self.lipsum.getWord()
            name = self.lipsum.getWord() + " " + self.lipsum.getWord()
            email = self.lipsum.getWord() + "@example.org"

            server_url = self.server_url

            csrftoken = extract_token(self.getBody(), "name='csrfmiddlewaretoken' value='", "' />")
            self.post(server_url + "/register",
                params=[ ['csrfmiddlewaretoken', csrftoken],
                ['username', username],
                ['password1', password],
                ['password2', password],
                ['name', name],
                ['email', email],
                ['profiletype', '1']],
                description="Post /register")

            self.assert_("index" in self.getLastUrl(), "Error in registration")
            self.logout()

    def test_credential(self):
        credential_host = self.conf_get('credential', 'host')
        credential_port = self.conf_getInt('credential', 'port')
        login, pwd = xmlrpc_get_credential(credential_host, credential_port
            , "group1")
        self.login_as(login, pwd)
        self.logout()

    def test_show_all_users(self):
        page = "/users"
        self.login_as("admin", "admin", page, "Get users")
        self.assert_(page == self.getLastUrl(), "Error in login")
        reply = self.get(self.server_url + page, description="Get users")
        self.logout()
class SeamBooking(FunkLoadTestCase):
    """Simple test to register a new user and book an hotel.

    This test uses the configuration file SeamBooking.conf.
    """

    jsf_tag_tree = '<input type="hidden" name="jsf_tree_64" id="jsf_tree_64" value="'
    jsf_tag_state = '<input type="hidden" name="jsf_state_64" id="jsf_state_64" value="'

    hotel_names = ["Tower", "Ritz", "Sea", "Hotel"]
    nb_letters = 3        # number of letter to type when searching an hotel
    password = "password" # password used for users

    def jsfParams(self, params):
        """Helper to extarct jsf states from the last page and add them to the params."""
        html = self.getBody()
        tag = self.jsf_tag_tree
        start = html.find(tag) + len(tag)
        end = html.find('"', start)
        if start < 0 or end < 0:
            raise ValueError('No Jsf STATE TREE found in the previous page.')
        state = html[start:end]
        params.insert(0, ["jsf_tree_64", state])
        tag = self.jsf_tag_state
        start = html.find(tag) + len(tag)
        end = html.find('"', start)
        if start < 0 or end < 0:
            raise ValueError('No Jsf STATE STATE found in the previous page.')
        state = html[start:end]
        params.insert(1, ["jsf_state_64", state])
        return params


    def setUp(self):
        """Setting up test."""
        self.logd("setUp")
        self.server_url = self.conf_get('main', 'url')
        self.lipsum = Lipsum()


    def test_seam_booking(self):
        # The description should be set in the configuration file
        server_url = self.server_url

        self.get(server_url + "/seam-booking/home.seam",
            description="Booking home page")
        register_link = self.listHref(content_pattern="Register New User")
        self.assert_(len(register_link), "Register link not found")
        register_link = register_link[0]

        self.get(server_url + register_link,
                 description="Register new User")
        self.assert_("register_SUBMIT" in self.getBody(),
                     "Failing to view Registration page.")

        username = self.lipsum.getUniqWord()
        realname = username + " " + self.lipsum.getUniqWord()
        password = self.password

        self.post(server_url + "/seam-booking/register.seam", self.jsfParams(params=[
            ['register:username', username],
            ['register:name', realname],
            ['register:password', password],
            ['register:verify', password],
            ['register:register', 'Register'],
            ['register_SUBMIT', '1'],
            ['register:_link_hidden_', ''],
            ['jsf_viewid', '/register.xhtml']]),
            description="Submit register form")
        self.assert_("Successfully registered as" in self.getBody(),
                     "Failing register new user.")
        params = self.jsfParams(params=[
            ['login:username', username],
            ['login:password', password],
            ['login:login', 'Account Login'],
            ['login_SUBMIT', '1'],
            ['login:_link_hidden_', ''],
            ['jsf_viewid', '/home.xhtml']])
        self.post(server_url + "/seam-booking/home.seam", params,
            description="Submit account login")
        self.assert_(username in self.getBody(),
                     "Failing login new user %s:%s" % (username, password) + str(params))
        self.assert_("No Bookings Found" in self.getBody(),
                     "Weird there should be no booking for new user %s:%s" %
                     (username, password))

        # Simulate ajax search for an hotel by typing nb_letters
        nb_letters = self.nb_letters
        hotel_query = random.choice(self.hotel_names)
        for i in range(1, nb_letters + 1):
            self.post(server_url + "/seam-booking/main.seam", self.jsfParams(params=[
            ['AJAXREQUEST', '_viewRoot'],
            ['main:searchString', hotel_query[:i]],
            ['main:pageSize', '10'],
            ['main_SUBMIT', '1'],
            ['jsf_viewid', '/main.xhtml'],
            ['main:findHotels', 'main:findHotels']]),
            description="Ajax search %i letter" % i)
            self.assert_("View Hotel" in self.getBody(),
                         "No match for search hotel.")

        # Extract the list of link to hotel and choose a random one
        hotel_links = self.listHref(content_pattern="View Hotel")
        self.get(server_url + random.choice(hotel_links),
                 description="View a random hotel in the result list")
        self.assert_("hotel_SUBMIT" in self.getBody())

        self.post(server_url + "/seam-booking/hotel.seam", self.jsfParams(params=[
            ['hotel:bookHotel', 'Book Hotel'],
            ['hotel_SUBMIT', '1'],
            ['hotel:_link_hidden_', ''],
            ['jsf_viewid', '/hotel.xhtml']]),
            description="Book hotel")
        self.assert_("booking_SUBMIT" in self.getBody())

        self.post(server_url + "/seam-booking/book.seam", self.jsfParams(params=[
            ['booking:checkinDate', '11/07/2008'],
            ['booking:checkoutDate', '11/08/2008'],
            ['booking:beds', '1'],
            ['booking:smoking', 'false'],
            ['booking:creditCard', '1234567890123456'],
            ['booking:creditCardName', realname],
            ['booking:creditCardExpiryMonth', '1'],
            ['booking:creditCardExpiryYear', '2009'],
            ['booking:proceed', 'Proceed'],
            ['booking_SUBMIT', '1'],
            ['booking:_link_hidden_', ''],
            ['jsf_viewid', '/book.xhtml']]),
            description="Proceed booking")
        self.assert_("confirm_SUBMIT" in self.getBody())

        self.post(server_url + "/seam-booking/confirm.seam", self.jsfParams(params=[
            ['confirm:confirm', 'Confirm'],
            ['confirm_SUBMIT', '1'],
            ['confirm:_link_hidden_', ''],
            ['jsf_viewid', '/confirm.xhtml']]),
            description="Confirm booking")
        self.assert_("No Bookings Found" not in self.getBody(),
                     "Booking is not taken in account.")

        # Logout
        logout_link = self.listHref(content_pattern="Logout")
        self.assert_(len(logout_link), "Logout link not found")
        logout_link = logout_link[0]
        self.get(server_url + logout_link,
            description="Logout")
        self.assert_("login_SUBMIT" in self.getBody())

        # end of test -----------------------------------------------

    def tearDown(self):
        """Setting up test."""
        self.logd("tearDown.\n")
class Contentcreation(FunkLoadTestCase.FunkLoadTestCase):
    """Content creation load test scenario

    This test use a configuration file Contentcreation.conf.
    """

    def setUp(self):
        """Setting up test."""
        self.logd("setUp")
        self.server_url = self.conf_get('main', 'url')
        self.users_list = open(os.path.dirname(os.path.dirname(__file__)) + '/profiles/contentcreation/users_list.txt', 'r').readlines()
        self.user_id = random.choice(self.users_list).strip()         
        self.lipsum = Lipsum(vocab=V_ASCII, chars=CHARS, sep=SEP)

    def test_ContentCreation(self):
        # The description should be set in the configuration file
        
        server_url = self.server_url
        # begin of test ---------------------------------------------
        
        self.post(server_url + "/coreloadtests/login_form", params=[
            ['form.submitted', '1'],
            ['js_enabled', '0'],
            ['cookies_enabled', '0'],
            ['login_name', ''],
            ['pwd_empty', '0'],
            ['came_from', 'login_success'],
            ['__ac_name', self.user_id],
            ['__ac_password', 'testpw']],
            description="Post /coreloadtests/login_form")        
        
        folder_portal_factory = self._browse(server_url + "/coreloadtests/Members/" + self.user_id +"/createObject?type_name=Folder",
                                             method='get', 
                                             follow_redirect=False,
                                             description = 'Get folder portal factory')

        folder_edit_url = folder_portal_factory.headers.get('Location')        
        folder_id = folder_edit_url.split('/')[-2]
 
        folder_created = self.post(folder_edit_url, params=[
            ['id', folder_id],
            ['title', 'folder'],
            ['description', ''],
            ['description_text_format', 'text/plain'],
            ['subject_existing_keywords:default:list', ''],
            ['location', ''],
            ['language', ''],
            ['effectiveDate', ''],
            ['effectiveDate_year', '0000'],
            ['effectiveDate_month', '00'],
            ['effectiveDate_day', '00'],
            ['effectiveDate_hour', '12'],
            ['effectiveDate_minute', '00'],
            ['effectiveDate_ampm', 'AM'],
            ['expirationDate', ''],
            ['expirationDate_year', '0000'],
            ['expirationDate_month', '00'],
            ['expirationDate_day', '00'],
            ['expirationDate_hour', '12'],
            ['expirationDate_minute', '00'],
            ['expirationDate_ampm', 'AM'],
            ['creators:lines', 'user'],
            ['contributors:lines', ''],
            ['rights', ''],
            ['rights_text_format', 'text/html'],
            ['allowDiscussion:boolean:default', ''],
            ['excludeFromNav:boolean:default', ''],
            ['nextPreviousEnabled:boolean:default', ''],
            ['fieldsets:list', 'default'],
            ['fieldsets:list', 'categorization'],
            ['fieldsets:list', 'dates'],
            ['fieldsets:list', 'ownership'],
            ['fieldsets:list', 'settings'],
            ['form.submitted', '1'],
            ['add_reference.field:record', ''],
            ['add_reference.type:record', ''],
            ['add_reference.destination:record', ''],
            ['last_referer', 'http://localhost:8080/coreloadtests/Members/' + self.user_id + '/view'],
            ['form_submit', 'Save']],
            description="Post /coreloadtests/Members/user...280843853/atct_edit")

        new_folder_id = folder_created.url.split('/')[-2]

        document_portal_factory = self._browse(server_url + "/coreloadtests/Members/" + self.user_id +"/" + new_folder_id + "/createObject?type_name=Document",
                                             method='get', 
                                             follow_redirect=False,
                                             description = 'Get document portal factory')

        document_edit_url = document_portal_factory.headers.get('Location')        
        document_id = document_edit_url.split('/')[-2]
        
        self.post(document_edit_url, params=[                                                                                                                                                         
            ['id', document_id],
            ['title', self.lipsum.getSubject(length=5, prefix=None, uniq=False,length_min=None, length_max=None)],
            ['description', self.lipsum.getMessage(length=10)],
            ['description_text_format', 'text/plain'],
            ['text_text_format', 'text/html'],
            ['text_text_format:default', 'text/html'],
            ['text', self.lipsum.getMessage(length=30)],
            ['text_file', Upload("")],
            ['subject_existing_keywords:default:list', ''],
            ['relatedItems:default:list', ''],
            ['location', ''],
            ['language', ''],
            ['effectiveDate', ''],
            ['effectiveDate_year', '0000'],
            ['effectiveDate_month', '00'],
            ['effectiveDate_day', '00'],
            ['effectiveDate_hour', '12'],
            ['effectiveDate_minute', '00'],
            ['effectiveDate_ampm', 'AM'],
            ['expirationDate', ''],
            ['expirationDate_year', '0000'],
            ['expirationDate_month', '00'],
            ['expirationDate_day', '00'],
            ['expirationDate_hour', '12'],
            ['expirationDate_minute', '00'],
            ['expirationDate_ampm', 'AM'],
            ['creators:lines', 'user'],
            ['contributors:lines', ''],
            ['rights', ''],
            ['rights_text_format', 'text/html'],
            ['allowDiscussion:boolean:default', ''],
            ['excludeFromNav:boolean:default', ''],
            ['presentation:boolean:default', ''],
            ['tableContents:boolean:default', ''],
            ['cmfeditions_version_comment', 'Lorem Ipsum'],
            ['fieldsets:list', 'default'],
            ['fieldsets:list', 'categorization'],
            ['fieldsets:list', 'dates'],
            ['fieldsets:list', 'ownership'],
            ['fieldsets:list', 'settings'],
            ['form.submitted', '1'],
            ['add_reference.field:record', ''],
            ['add_reference.type:record', ''],
            ['add_reference.destination:record', ''],
            ['last_referer', 'http://localhost:8080/coreloadtests/Members/' + self.user_id +'/' + new_folder_id + '/'],
            ['form_submit', 'Save']],
            description="Post /coreloadtests/Members/user...511052309/atct_edit")

        self.get(server_url + "/coreloadtests/logout",
            description="Get /coreloadtests/logout")

        # end of test -----------------------------------------------

    def tearDown(self):
        """Setting up test."""
        self.logd("tearDown.\n")
 def setUp(self):
     """Setting up test."""
     self.logd("setUp")
     self.server_url = self.conf_get('main', 'url')
     self.lipsum = Lipsum(vocab=V_ASCII, chars=CHARS, sep=SEP)
class Writeheavy(FunkLoadTestCase.FunkLoadTestCase):
    """Heavy write load test scenario

    This test use a configuration file Writeheavy.conf.
    """

    def setUp(self):
        """Setting up test."""
        self.logd("setUp")
        self.server_url = self.conf_get('main', 'url')
        self.lipsum = Lipsum(vocab=V_ASCII, chars=CHARS, sep=SEP)
        # XXX here you can setup the credential access like this
        # credential_host = self.conf_get('credential', 'host')
        # credential_port = self.conf_getInt('credential', 'port')
        # self.login, self.password = xmlrpc_get_credential(credential_host,
        #                                                   credential_port,
        # XXX replace with a valid group
        #                                                   'members')

    def test_WriteHeavy(self):
        # The description should be set in the configuration file
        
        server_url = self.server_url
        # begin of test ---------------------------------------------

        self.get(server_url + "/coreloadtests",
            description="Get /coreloadtests")

        join_form = self.get(server_url + "/coreloadtests/register",
                          description="Get /coreloadtests/register")

        _authenticator = AUTHENTICATOR_RE.search(join_form.body).group(1)

        user_id = self.lipsum.getWord()
        user_fullname = self.lipsum.getSubject(length=2, prefix=None, uniq=True)
        
        self.post(server_url + "/coreloadtests/register", params=[
            ['form.fullname', user_fullname],
            ['form.username', user_id],
            ['form.email', '[email protected]'],
            ['form.password', '12345'],
            ['form.password_ctl', '12345'],
            ['form.actions.register', 'Register'],
            ['_authenticator', _authenticator]],
            description="Post /coreloadtests/register")

        self.post(server_url + "/coreloadtests/login_form", params=[
            ['form.submitted', '1'],
            ['js_enabled', '0'],
            ['cookies_enabled', '0'],
            ['login_name', ''],
            ['pwd_empty', '0'],
            ['came_from', 'login_success'],
            ['__ac_name', user_id],
            ['__ac_password', '12345']],
            description="Post /coreloadtests/login_form")

        self.get(server_url + "/coreloadtests/dashboard",
            description="Get /coreloadtests/dashboard")

        self.get(server_url + "/coreloadtests/Members/" + user_id +"/view",
            description="Get /coreloadtests/Members/user/view")

        folder_portal_factory = self._browse(server_url + "/coreloadtests/Members/" + user_id +"/createObject?type_name=Folder",
                                             method='get', 
                                             follow_redirect=False,
                                             description = 'Get folder portal factory')

        folder_edit_url = folder_portal_factory.headers.get('Location')        
        folder_id = folder_edit_url.split('/')[-2]
 
        folder_created = self.post(folder_edit_url, params=[
            ['id', folder_id],
            ['title', 'folder'],
            ['description', ''],
            ['description_text_format', 'text/plain'],
            ['subject_existing_keywords:default:list', ''],
            ['location', ''],
            ['language', ''],
            ['effectiveDate', ''],
            ['effectiveDate_year', '0000'],
            ['effectiveDate_month', '00'],
            ['effectiveDate_day', '00'],
            ['effectiveDate_hour', '12'],
            ['effectiveDate_minute', '00'],
            ['effectiveDate_ampm', 'AM'],
            ['expirationDate', ''],
            ['expirationDate_year', '0000'],
            ['expirationDate_month', '00'],
            ['expirationDate_day', '00'],
            ['expirationDate_hour', '12'],
            ['expirationDate_minute', '00'],
            ['expirationDate_ampm', 'AM'],
            ['creators:lines', 'user'],
            ['contributors:lines', ''],
            ['rights', ''],
            ['rights_text_format', 'text/html'],
            ['allowDiscussion:boolean:default', ''],
            ['excludeFromNav:boolean:default', ''],
            ['nextPreviousEnabled:boolean:default', ''],
            ['fieldsets:list', 'default'],
            ['fieldsets:list', 'categorization'],
            ['fieldsets:list', 'dates'],
            ['fieldsets:list', 'ownership'],
            ['fieldsets:list', 'settings'],
            ['form.submitted', '1'],
            ['add_reference.field:record', ''],
            ['add_reference.type:record', ''],
            ['add_reference.destination:record', ''],
            ['last_referer', 'http://localhost:8080/coreloadtests/Members/' + user_id + '/view'],
            ['form_submit', 'Save']],
            description="Post /coreloadtests/Members/user...280843853/atct_edit")

        new_folder_id = folder_created.url.split('/')[-2]

        document_portal_factory = self._browse(server_url + "/coreloadtests/Members/" + user_id +"/" + new_folder_id + "/createObject?type_name=Document",
                                             method='get', 
                                             follow_redirect=False,
                                             description = 'Get document portal factory')

        document_edit_url = document_portal_factory.headers.get('Location')        
        document_id = document_edit_url.split('/')[-2]
        
        self.post(document_edit_url, params=[
            ['id', document_id],
            ['title', self.lipsum.getSubject(length=5, prefix=None, uniq=False,length_min=None, length_max=None)],
            ['description', self.lipsum.getMessage(length=10)],
            ['description_text_format', 'text/plain'],
            ['text_text_format', 'text/html'],
            ['text_text_format:default', 'text/html'],
            ['text', self.lipsum.getMessage(length=30)],
            ['text_file', Upload("")],
            ['subject_existing_keywords:default:list', ''],
            ['relatedItems:default:list', ''],
            ['location', ''],
            ['language', ''],
            ['effectiveDate', ''],
            ['effectiveDate_year', '0000'],
            ['effectiveDate_month', '00'],
            ['effectiveDate_day', '00'],
            ['effectiveDate_hour', '12'],
            ['effectiveDate_minute', '00'],
            ['effectiveDate_ampm', 'AM'],
            ['expirationDate', ''],
            ['expirationDate_year', '0000'],
            ['expirationDate_month', '00'],
            ['expirationDate_day', '00'],
            ['expirationDate_hour', '12'],
            ['expirationDate_minute', '00'],
            ['expirationDate_ampm', 'AM'],
            ['creators:lines', 'user'],
            ['contributors:lines', ''],
            ['rights', ''],
            ['rights_text_format', 'text/html'],
            ['allowDiscussion:boolean:default', ''],
            ['excludeFromNav:boolean:default', ''],
            ['presentation:boolean:default', ''],
            ['tableContents:boolean:default', ''],
            ['cmfeditions_version_comment', 'Lorem Ipsum'],
            ['fieldsets:list', 'default'],
            ['fieldsets:list', 'categorization'],
            ['fieldsets:list', 'dates'],
            ['fieldsets:list', 'ownership'],
            ['fieldsets:list', 'settings'],
            ['form.submitted', '1'],
            ['add_reference.field:record', ''],
            ['add_reference.type:record', ''],
            ['add_reference.destination:record', ''],
            ['last_referer', 'http://localhost:8080/coreloadtests/Members/' + user_id +'/' + new_folder_id + '/'],
            ['form_submit', 'Save']],
            description="Post /coreloadtests/Members/user...511052309/atct_edit")

        self.get(server_url + "/coreloadtests/logout",
            description="Get /coreloadtests/logout")

        # end of test -----------------------------------------------

    def tearDown(self):
        """Setting up test."""
        self.logd("tearDown.\n")