Coder Social home page Coder Social logo

framy's Introduction

Framy generates svg file that shows nesting hierarchy of the views in the app.

Framy provides two main methods:

  • Future takeScreenshot(String screenshotName) - which takes screenshot of the current view of the app. To take screenshot FlutterDriver object is required.
  • void generateWireFrames(String directoryPath, String initialFileName) - which generates svg file that shows the nesting hierarchy of the views in the app. Every node is represented by image and name.

Usage

A simple usage example in tests:

import 'package:framy/framy.dart';
import 'package:test/test.dart';
import 'package:flutter_driver/flutter_driver.dart';

void main() {
  FlutterDriver driver;
  Framy framy;

  setUpAll(() async {
    driver = await FlutterDriver.connect();
    framy = Framy(driver: driver, groupName: 'app');
  });

  test('application test', () async {
     await driver.waitFor(find.byType('Scaffold'));
       await framy.takeScreenshot('1-initial_page');
       await driver.tap(find.byType('FloatingActionButton'));
       await framy.takeScreenshot('1.1-first_child_page');
       await driver.tap(find.byType('FloatingActionButton'));
       await driver.tap(find.byType('FloatingActionButton'));
       await framy.takeScreenshot('1.2-second_child_page');
       await driver.tap(find.byType('FloatingActionButton'));
       await driver.tap(find.byType('FloatingActionButton'));
       await driver.tap(find.byType('FloatingActionButton'));
       await framy.takeScreenshot('1.1.1-first_child_first_child_page');
       await driver.tap(find.byType('FloatingActionButton'));
       await framy.takeScreenshot('1.1.2-first_child_second_child_page');
       framy.generateWireFrames('framy/app', '1-initial_page');
  });
}

Above code will produce svg file output. This file will contain the screenshots that were taken during the test. The nesting hierarchy will look like this:

nesting hierarchy of the app views

Every file that will be considered has to be built from two main parts separated by '-'. First part shows the nesting hierarchy of the views in the app. Every dot means deeper view of the app. Second part contains name of the screenshot that will be displayed in svg file - name cannot include spaces.

1-initial_page.png, 1.1-home_page.png, 1.2.1-page_1.png are valid file names. 1.png, 1-home page.png, 1.-.png are invalid file names.

framy's People

Contributors

monias avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.