cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pavankumar Joshi (JIRA)" <>
Subject [jira] [Created] (CB-6771) Error in of Mobilespec340 filetransfer test cases
Date Wed, 28 May 2014 06:01:06 GMT
Pavankumar Joshi created CB-6771:

             Summary: Error in of Mobilespec340 filetransfer test cases
                 Key: CB-6771
             Project: Apache Cordova
          Issue Type: Bug
          Components: mobile-spec
    Affects Versions: 3.4.0
         Environment: Mobilespec340 testing on Google Nexus 7 device , with Android version
            Reporter: Pavankumar Joshi
            Priority: Minor

Recently I observed an error in Mobilespec File transfer test cases. I checked and found that
there are 3 test cases failing in Mobilespec project, they are
1) filetransfer.spec.18
2) filetransfer.spec.19
3) filetransfer.spec.29

The main cause of all test cases failure is due to the execution of this javascript statement
in jasmine.
1) “expect(uploadResult.response).toMatch(/fields:\s*{\s*value1.*/);”
That is the response object from the server is checked to see if it contains the fields like
value1 and test.
This fails because the actual JSON object in the uploadResult.response  object looks like
"fields":{"value1":"test","value2":"param"} ….
The Failure is mainly because of the double quotes(“) present in the response object. The
same test cases pass if it is modified like
2) “expect(uploadResult.response).toMatch(/”fields”:\s*{\s*”value1”.*/);” ( with
double quotes in toMatch method for fileds and value1)

I checked mobilespec3.5.0 version filetransfer.tests.js and still the matching expression
looks like (expect(uploadResult.response).toMatch(/fields:\s*{\s*value1.*/);)

I tested mobilespec290, and noticed that same file transfer test cases are failing now. I
tested mobilespec290 on motorola xoom device with Android 4.1.0 version

I think that the JSON response from server has changed
to include double quotes. 

Then I checked that in the master branch of file transfer mobile spec test case
The code is modified to test the response in a different way 
               var obj = null;
                try {
                    obj = JSON.parse(uploadResult.response);

This message was sent by Atlassian JIRA

View raw message