Results 1 to 2 of 2

Thread: Accessing the file system

  1. #1

    Default Accessing the file system

    I have a screen on my app that downloads a file from the server. Is there currently functionality that would allow sencha test to access the file system to read the file and delete it when it is done? I also may need to test file uploads in the future so being able to access the file system through sencha test would be great. Is this possible or planned currently?

  2. #2
    Sencha - Test Dev Team marcelofarias's Avatar
    Join Date
    Nov 2011
    Location
    Boca Raton, FL
    Posts
    75
    Answers
    5

    Default

    In WebDriver scenarios, your test code is actually running in an Electron child process, so you can simply use the Node.js API. Suppose you want to read a JSON file:

    Code:
    var fs = require('fs'),
        people = JSON.parse(fs.readFileSync('/home/jvoorhees/people.json', 'utf8'));
    
    console.log(people); // hope I don't see my name here #badjokeeel
    For in-browser scenarios, you can easily serve a directory from the local filesystem via HTTP using Sencha Cmd. Then just request the files via HTTP:

    Code:
    sencha web start
    Marcelo Bukowski de Farias

Similar Threads

  1. Returns false when data base accessing or system is slow
    By rubynile in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 17 Oct 2011, 1:11 AM
  2. Loading tree with external json file on local file system
    By sogo in forum Community Discussion
    Replies: 1
    Last Post: 8 Oct 2010, 4:03 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •