技術情報

WebdriverIO

WebdriverIO is an open source test automation framework written in JavaScript and running on NodeJS. This is especially useful when testing his web apps and native mobile apps for iOS devices. It supports both behavior-driven development (BDD) and test-driven development (TDD), making it a highly preferred choice for automation testers.

What is WebdriverIO? - DEV Community 👩‍💻👨‍💻

WebdriverIO is based on NodeJS, an implementation of the JSON Wire protocol. It communicates using NodeJS, packaged on npm, open source and widely used for app development. Run automated tests using RESTful architecture.

A user writes a test script in JavaScript using his WebdriverIO library. Service requests are sent as HTTP commands via NodeJS. It uses the JSON Wire protocol and the service module forwards the request to the browser.

Upon receiving the command, the browser performs the user’s action. This proves the functionality of the application.

Credit: BrowserStack

A common reason to use WebdriverIO is to be able to test native mobile apps for iOS-enabled devices. It is very useful for QA because of its simple structure and the ability to write test scripts concisely.

WebdriverIO easily integrates with third-party test solution providers such as BrowserStack. This gives QA easy access to additional features such as recording tests, using real cloud devices and browsers, and test reports.

Yuuma



flutterでモバイル/Wifiのようなネットワーク接続を確認する方法

今回は、Flutterのインターネット接続の種類が、モバイルデート、wifi接続、Bluetooth接続、Ethernet接続のいずれであるかを確認する方法をご紹介します。

まずはpubspec.yaml ファイルにパッケージを追加する。

connectivity_plus: ^2.3.6

インターネット接続の種類を確認する方法

  checkConnection() async{
    var connectivityResult = await (Connectivity().checkConnectivity());
    if (connectivityResult == ConnectivityResult.mobile) {
      cType = "Mobile Data";
    } else if (connectivityResult == ConnectivityResult.wifi) {
      cType = "Wifi Network";
    }else if(connectivityResult == ConnectivityResult.ethernet){
      cType = "Ethernet Network";
    }else if(connectivityResult == ConnectivityResult.bluetooth){
      cType = "Blutooth Data connection";
    }else{
      cType = "none";
    }

    setState(() {
      
    });
  }

上記の機能をinitState()で呼び出します。

  void initState() {
    checkConnection();
    super.initState();
  }

表示ようコード

Scaffold(
        appBar: AppBar(
            title: const Text("Check Network Connection Type"),
            backgroundColor: Colors.blueAccent
        ),
        body: Container(
            padding: EdgeInsets.only(top:20, left:20, right:20),
            alignment: Alignment.topCenter,
            child: Column(
              children: [
                Text("Connection Type: $cType", style: TextStyle(fontSize: 20),),
              ],)
        )
    );

金曜担当 – Ami



Flutter で自動で次のTextFieldを移動する方法

複数のテキスト入力を持つフォームで、現在のtextFieldで入力した後、次の入力フォームに自動でfocsuしたい場合、以下の方法でできます。

TextFieldウィジェットのtextInputActionでTextInputAction.nextを使うと、自動で移動します。

最後の TextFieldウィジェットのtextInputActionでは
TextInputAction.doneを設定してると、focusが外れるようになっています。

Column(
              children: const <Widget>[
                TextField(
                  decoration: InputDecoration(hintText: 'TextField A'),
                  textInputAction: TextInputAction.next, // Moves focus to next.
                ),
                TextField(
                  decoration: InputDecoration(hintText: 'TextField B'),
                  textInputAction: TextInputAction.next, // Moves focus to next.
                ),
                TextField(
                  decoration: InputDecoration(hintText: 'TextField C'),
                  textInputAction: TextInputAction.done, // Hides the keyboard.
                ),
              ],
            ),

以上です。

参考

https://stackoverflow.com/questions/52150677/how-to-shift-focus-to-the-next-textfield-in-flutter

金曜担当 – Ami



JSON Crack

JSON Crack is a tool for generating graphical diagrams from JSON objects. These diagrams are much easier to navigate and more useful than their textual formats.

preview
Credit: JSON Crack

This is so convenient as we can update our JSON into graphs just by directly pasting on their website or importing. It generate the graphs to visualize without any additional values and saving time.

This also allows you to search the nodes which make easier if we are working on a large data set. Additionally, the generated diagrams can also be downloaded or clipboard as image.

Also check out the tweet from Github.

https://twitter.com/github/status/1519363257794015233

It also offers Microsoft’s Monaco editor, also used in VS Code, easily edits JSON and displays graphs directly. It also has a JSON validator to ensure there are no type errors.

You can checkout more detail on their website.

Yuuma



Flutter でAccordionを追加する方法

今回は、Flutterで展開・折りたたみ可能なAccordionを追加する方法を共有します。

方法 – 1

ExpansionTile()を使用する

            ExpansionTile(
              title: const Text("If you could live anywhere, where would it be? "),
              children: [
                Container(
                  color: Colors.black12,
                  padding:const EdgeInsets.all(20),
                  width: double.infinity,
                  child:  const Text("Answers for Question One"),
                )
              ],
            ),

ExpansionTileを使うと、Flutterで展開可能なAccordionや折りたたみ可能なAccordionを作ることができます。また、以下のように背景色を変更することができます。

            Card(
                color: Colors.blue[100],
                child:ExpansionTile(
                  title: const Text("What is your biggest fear?"),

                  children: [
                    Container(
                      color: Colors.black12,
                      padding:const EdgeInsets.all(20),
                      width: double.infinity,
                      child:  const Text("Answers for Question Two"),
                    )
                  ],
                )
            ),

方法 – 2

ExpansionPanelListとExpansionPanelを使用する

ExapnasionPanelの拡張状態リストを設定

List<bool> expanded = [false, true];

例の為、ExpansionPanelListの中にパネル2を作成し、最後のExapnasionPanelを展開するようにしたいので、trueに設定していきます。

ExpansionPanelList(
                expansionCallback: (panelIndex, isExpanded) {
                  setState(() {
                    expanded[panelIndex] = !isExpanded;
                  });
                },
                animationDuration: const Duration(seconds: 2),
                children:[
                  ExpansionPanel(
                      headerBuilder: (context, isOpen){
                        return const Padding(
                            padding: EdgeInsets.all(15),
                            child:Text("What motivates you to work hard?")
                        );
                      },
                      body: Container(
                        padding: const EdgeInsets.all(20),
                        color: Colors.redAccent[100],
                        width: double.infinity,
                        child: const Text("Answers for Question Three"),
                      ),
                      isExpanded: expanded[0]
                  ),

                  ExpansionPanel(
                      headerBuilder: (context, isOpen){
                        return const Padding(
                            padding: EdgeInsets.all(15),
                            child:Text("What did you want to be when you were small?")
                        );
                      },
                      body: Container(
                        padding: const EdgeInsets.all(20),
                        color: Colors.blueAccent[100],
                        width: double.infinity,
                        child: const Text("Answers for Question Four"),
                      ),
                      isExpanded: expanded[1]
                  )
                ]
            )

ということで、今回はこれで終わります。

金曜担当 – Ami




アプリ関連ニュース

お問い合わせはこちら

お問い合わせ・ご相談はお電話、またはお問い合わせフォームよりお受け付けいたしております。

tel. 06-6454-8833(平日 10:00~17:00)

お問い合わせフォーム