<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Grégoire</title>
    <description>The latest articles on Forem by Grégoire (@gpenverne).</description>
    <link>https://forem.com/gpenverne</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F257986%2Fa2bf1fd5-dfb6-40e7-b318-b66a2fa22c6c.jpeg</url>
      <title>Forem: Grégoire</title>
      <link>https://forem.com/gpenverne</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/gpenverne"/>
    <language>en</language>
    <item>
      <title>Earnapp: New payment threeshold</title>
      <dc:creator>Grégoire</dc:creator>
      <pubDate>Wed, 09 Feb 2022 15:14:11 +0000</pubDate>
      <link>https://forem.com/gpenverne/earnapp-new-payment-threeshold-2obh</link>
      <guid>https://forem.com/gpenverne/earnapp-new-payment-threeshold-2obh</guid>
      <description>&lt;p&gt;I previously writtent about &lt;a href="https://earnapp.com/i/dp64i9n"&gt;earnapp&lt;/a&gt; (in post &lt;a href="https://dev.to/gpenverne/how-to-earn-money-with-your-raspberry-pi-2l83"&gt;"How to earn money with your raspberry pi"&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A new update about this service (which allows you to rent your unused bandwith to earn passive income, ~ 0,5cts/day): the payment threeshold is now 2$50 (it was 5$ previously).&lt;/p&gt;

&lt;p&gt;A faster way to test it ^^&lt;/p&gt;

</description>
      <category>raspberrypi</category>
    </item>
    <item>
      <title>Earn passive income with windows</title>
      <dc:creator>Grégoire</dc:creator>
      <pubDate>Thu, 03 Feb 2022 10:36:26 +0000</pubDate>
      <link>https://forem.com/gpenverne/earn-passive-income-with-windows-3ekh</link>
      <guid>https://forem.com/gpenverne/earn-passive-income-with-windows-3ekh</guid>
      <description>&lt;p&gt;In a previous article (&lt;a href="https://gkdv.net/earn-money-with-raspberry-pi/"&gt;How to earn money with a raspbery pi&lt;/a&gt;), I written about &lt;a href="https://earnapp.com/i/dp64i9n"&gt;earnapp&lt;/a&gt;, which makes earn money with a raspberry pi.  &lt;/p&gt;

&lt;p&gt;By the way, you can do it with your windows or mac os computer, thanks to &lt;a href="https://r.honeygain.me/GPENV64FEF"&gt;HoneyGain&lt;/a&gt; (Yeah I know, earnapp can be installed on a computer too...). &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3YUOLAeO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://gkdv.net/images/uploads/2022/01/revenus-passifs-windows-avis-honeygain.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3YUOLAeO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://gkdv.net/images/uploads/2022/01/revenus-passifs-windows-avis-honeygain.jpg" alt="passive earnings on windows" title="honeyGain windows" width="538" height="464"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;The main difference with earnapp is the payment threeshold: on &lt;a href="https://r.honeygain.me/GPENV64FEF"&gt;HoneyGain&lt;/a&gt;), it's from 20$ (vs 5$ on earnapp). &lt;/p&gt;

&lt;p&gt;The other difference is the "cdn" feature: this will allow honeyGain to use your bandwith as a cdn for other clients. Another good point: no need to link a google account. &lt;/p&gt;

&lt;p&gt;And all the "how-it-works" it's really simply explained on her documentation. You have to notice that vpn-use is forbidden. &lt;/p&gt;

&lt;p&gt;I personnaly started to use it, and the earnings are similar to &lt;a href="https://earnapp.com/i/dp64i9n"&gt;earnapp&lt;/a&gt; (~0,5cts per day): why don't use the both? ;)&lt;/p&gt;

&lt;p&gt;Have a look on &lt;a href="https://r.honeygain.me/GPENV64FEF"&gt;HoneyGain&lt;/a&gt;, and try it!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to earn money with your raspberry pi</title>
      <dc:creator>Grégoire</dc:creator>
      <pubDate>Thu, 06 Jan 2022 16:35:59 +0000</pubDate>
      <link>https://forem.com/gpenverne/how-to-earn-money-with-your-raspberry-pi-2l83</link>
      <guid>https://forem.com/gpenverne/how-to-earn-money-with-your-raspberry-pi-2l83</guid>
      <description>&lt;p&gt;&lt;a href="https://gkdv.net/earn-money-with-raspberry-pi/"&gt;Read original article on gkdv.net&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;How to earn money with a raspbery pi? It's simple, with &lt;a href="https://earnapp.com/i/dp64i9n"&gt;earnapp&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What do you need
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;a &lt;a href="https://amzn.to/3dV7a4S"&gt;raspberry pi&lt;/a&gt; (of course ;))&lt;/li&gt;
&lt;li&gt;a &lt;a href="https://earnapp.com/i/dp64i9n"&gt;earnapp.com account&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How to install?
&lt;/h2&gt;

&lt;p&gt;At first, register on &lt;a href="https://earnapp.com/i/dp64i9n"&gt;earnapp&lt;/a&gt;. It's free and fast. Next, you have to install the earnapp client on your raspberry pi:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wget &lt;span class="nt"&gt;-qO-&lt;/span&gt; https://brightdata.com/static/earnapp/install.sh &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /tmp/earnapp.sh 
&lt;span class="nb"&gt;sudo &lt;/span&gt;bash /tmp/earnapp.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After the install, you obtain a device id to copy/paste on your earnapp dashboard. &lt;/p&gt;

&lt;h2&gt;
  
  
  How does it work
&lt;/h2&gt;

&lt;p&gt;Your raspberry pi will be used as a scrapper by big companies. The more your bandwith will be used, the more you will earn. Nothing to do after install.&lt;/p&gt;

&lt;p&gt;I actually earn 0,50€ per day. Not a dream, but on a month, it's best than nothing. You will be paid by paypal, when you reach 5$. I really received the payment :)&lt;/p&gt;

&lt;p&gt;Try it on &lt;a href="https://earnapp.com/i/dp64i9n"&gt;earnapp&lt;/a&gt;!&lt;/p&gt;

</description>
      <category>raspberrypi</category>
    </item>
    <item>
      <title>Make sound volume presets for your chromecasts</title>
      <dc:creator>Grégoire</dc:creator>
      <pubDate>Tue, 18 Feb 2020 07:15:55 +0000</pubDate>
      <link>https://forem.com/gpenverne/make-sound-volume-presets-for-your-chromecasts-5dbm</link>
      <guid>https://forem.com/gpenverne/make-sound-volume-presets-for-your-chromecasts-5dbm</guid>
      <description>&lt;p&gt;Read the original article on &lt;a href="https://gkdv.net/chromecast-auto-reset-volume-presets/"&gt;GKDV&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Sometimes, I tell to Google “Up the volume”, or “Down the volume” on one or several chromecast devices. But the next day, when I want to listen music again, the volume of each device does not match with my mood. I would love to reset all the volumes in few secondes, but I have to open the home application, and reset each device… Boring… With &lt;code class="highlighter-rouge"&gt;chromecast-reset-volume&lt;/code&gt; I can now configure some presets to autoreset the volumes as it was previously: reset all in one cli command :)&lt;/p&gt;

&lt;h2 id="what-do-you-need"&gt;What do you need&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;1 raspberry pi with python3&lt;/li&gt;
  &lt;li&gt;chromecasts… (of course)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id="get-source-files-and-install-it"&gt;Get source files and install it&lt;/h2&gt;

&lt;pre class="highlight"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;git clone https://github.com/gpenverne/chromecast-reset-volume
&lt;span class="nv"&gt;$ &lt;/span&gt;make &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id="configure-it"&gt;Configure it!&lt;/h2&gt;

&lt;p&gt;Open the &lt;code class="highlighter-rouge"&gt;config.py&lt;/code&gt; and customize your presets. For example:&lt;/p&gt;

&lt;pre class="highlight"&gt;&lt;code&gt;&lt;span class="n"&gt;VOLUMES&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="s"&gt;'default'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="s"&gt;'123.123.123.123'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="s"&gt;'tv'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="s"&gt;'room'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.1&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You can write the chromecast name or its ip address (ip address will be faster).&lt;/p&gt;

&lt;h2 id="lets-the-magic-does-the-magic-"&gt;Let’s the magic does the magic :)&lt;/h2&gt;

&lt;pre class="highlight"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;make apply
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And all your configured chromecasts volumes will be setted :)&lt;/p&gt;

</description>
      <category>chromecast</category>
      <category>python</category>
      <category>music</category>
    </item>
    <item>
      <title>Functional tests with puppeteer and gherkin scenarios</title>
      <dc:creator>Grégoire</dc:creator>
      <pubDate>Fri, 14 Feb 2020 08:52:04 +0000</pubDate>
      <link>https://forem.com/gpenverne/functional-tests-with-puppeteer-and-gherkin-scenarios-2ha6</link>
      <guid>https://forem.com/gpenverne/functional-tests-with-puppeteer-and-gherkin-scenarios-2ha6</guid>
      <description>&lt;p&gt;Read the original article on &lt;a href="https://gkdv.net/functional-tests-using-puppeteer-and-gherkin/"&gt;GKDV&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For my custom needs, I was looking for puppeteer functional testing suite. As a php developer, I ordinary use behat to write and play my functional tests. But the project I want to test is python written, and I don’t want to install and configure PHP just to run tests. And what about puppeteer and chrome headless engine? Hey, I had an idea: implement the cool gherkin syntax with puppeteer in pyhton.&lt;/p&gt;

&lt;h2 id="about-gherkin"&gt;About Gherkin&lt;/h2&gt;

&lt;p&gt;Gherkin is a syntax which looks like:&lt;/p&gt;

&lt;pre class="highlight"&gt;&lt;code&gt;Feature: Use the rest test suite

    Scenario: We can fetch data from an api
        Given I add these headers:
            | accept | application/json |
        Given I prepare a "GET" request to "/todos/1"
        When I send the request
        Then print the last json response
        And the json node "anythng" should not exist
        And the json node "userId" should exist
        And the json node "id" should be equal to "1"
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;It’s readable by human, (I mean, by non-developer human :)) and it’s really easy to write.&lt;/p&gt;

&lt;h2 id="about-puppeteer"&gt;About Puppeteer&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/GoogleChrome/puppeteer"&gt;Puppeteer&lt;/a&gt; is a Node library which provides a high-level API to control Chrome or Chromium over the DevTools Protocol, and allows to execute actions in a headless (without visible UI) version of chrome.
In nodejs, these tests look like:&lt;/p&gt;

&lt;pre class="highlight"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;puppeteer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;puppeteer&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;browser&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;puppeteer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;launch&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;browser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;newPage&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;setRequestInterception&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;request&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;request&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;resourceType&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;image&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;abort&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt;
      &lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;continue&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;goto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://news.google.com/news/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;screenshot&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;news.png&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;fullPage&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;browser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;close&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;})();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Understandable by developers, but a bit ugly (and boring to write)…
However, using a real browser as chrome to play functional tests has a lot of advantages:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;javascript testing&lt;/li&gt;
  &lt;li&gt;speed&lt;/li&gt;
  &lt;li&gt;easy to use&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id="lets-play-with-pyppettheater"&gt;Let’s play with pyppettheater&lt;/h2&gt;

&lt;p&gt;Pyppettheater is one of my amaziiing idea (and it’s what this article is about).
In python, the puppether engine can be used thanks to &lt;a href="https://github.com/miyakogi/pyppeteer"&gt;Pyppeteer&lt;/a&gt;. And to parse the gherkin features files, we’ll use gherkin-parser.&lt;/p&gt;

&lt;h3 id="install-pyppetheater"&gt;Install pyppetheater&lt;/h3&gt;

&lt;p&gt;First, you have to install the chrome headless engine (under ubuntu):&lt;/p&gt;

&lt;pre class="highlight"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;wget &lt;span class="nt"&gt;-q&lt;/span&gt; &lt;span class="nt"&gt;-O&lt;/span&gt; - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
&lt;span class="nv"&gt;$ &lt;/span&gt;sh &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s1"&gt;'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" &amp;gt;&amp;gt; /etc/apt/sources.list.d/google-chrome.list'&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;apt-get &lt;span class="nt"&gt;-y&lt;/span&gt; update
&lt;span class="nv"&gt;$ &lt;/span&gt;apt-get &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-yqq&lt;/span&gt; unzip &lt;span class="nb"&gt;sudo &lt;/span&gt;python3-pip mysql-client google-chrome-stable
&lt;span class="nv"&gt;$ &lt;/span&gt;wget &lt;span class="nt"&gt;-O&lt;/span&gt; /tmp/chromedriver.zip http://chromedriver.storage.googleapis.com/&lt;span class="sb"&gt;`&lt;/span&gt;curl &lt;span class="nt"&gt;-sS&lt;/span&gt; chromedriver.storage.googleapis.com/LATEST_RELEASE&lt;span class="sb"&gt;`&lt;/span&gt;/chromedriver_linux64.zip
&lt;span class="nv"&gt;$ &lt;/span&gt;unzip /tmp/chromedriver.zip chromedriver &lt;span class="nt"&gt;-d&lt;/span&gt; /usr/local/bin/
&lt;span class="nv"&gt;$ &lt;/span&gt;pyppeteer-install
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And install pyppettheater:&lt;/p&gt;

&lt;pre class="highlight"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;pip3 &lt;span class="nb"&gt;install &lt;/span&gt;Pyppetheater
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You can now run the &lt;code class="highlighter-rouge"&gt;pyppet_theater&lt;/code&gt; binary:&lt;/p&gt;

&lt;pre class="highlight"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;pyppet_theater /path/to/your/yml/or/feature/file
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id="some-example-of-test"&gt;Some example of test&lt;/h3&gt;

&lt;p&gt;Each test suite is a yml file which contains some parameters (if needed):&lt;/p&gt;

&lt;pre class="highlight"&gt;&lt;code&gt;&lt;span class="na"&gt;parameters&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;rest&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;base_endpoint&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;https://jsonplaceholder.typicode.com&lt;/span&gt;

&lt;span class="na"&gt;scenarios&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;0&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;rest/rest-suite.feature&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;h4 id="for-a-rest-api"&gt;For a REST API:&lt;/h4&gt;

&lt;p&gt;For example in the rest/rest-suite.feature:&lt;/p&gt;

&lt;pre class="highlight"&gt;&lt;code&gt;Feature: Use the rest test suite

    Scenario: We can fetch data from an api
        Given I add these headers:
            | accept | application/json |
        Given I prepare a "GET" request to "/todos/1"
        When I send the request
        Then print the last json response
        And the json node "anythng" should not exist
        And the json node "userId" should exist
        And the json node "id" should be equal to "1"
&lt;/code&gt;&lt;/pre&gt;

&lt;pre class="highlight"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;pyppet_theater rest.yml
&lt;/code&gt;&lt;/pre&gt;

&lt;h4 id="for-a-frontend-test"&gt;For a frontend test:&lt;/h4&gt;

&lt;p&gt;For example, in a game/registration.feature file:&lt;/p&gt;

&lt;pre class="highlight"&gt;&lt;code&gt;Feature: Create an account on a website

    Scenario: As a visitor, I register on the website
        Given I go on "http://my-website.com"
        And I click on "\#signup-link"
        And I type "player6" in field "\#id_username"
        And I type "somepassword" in field "\#id_password1"
        And I type "somepassword" in field "\#id_password2"
        When I click on "\#register"
        Then I should be on "http://my-website.com"
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And run it:&lt;/p&gt;

&lt;pre class="highlight"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;pyppet_theater game/registration.feature
&lt;/code&gt;&lt;/pre&gt;

&lt;h4 id="for-mysql-tests"&gt;For mysql tests:&lt;/h4&gt;

&lt;p&gt;With a &lt;code class="highlighter-rouge"&gt;mysql.yml&lt;/code&gt; file&lt;/p&gt;

&lt;pre class="highlight"&gt;&lt;code&gt;&lt;span class="na"&gt;parameters&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;mysql&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;db_host&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;127.0.0.1&lt;/span&gt;
        &lt;span class="na"&gt;db_user&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;root&lt;/span&gt;
        &lt;span class="na"&gt;db_password&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;root&lt;/span&gt;
        &lt;span class="na"&gt;db_name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;test&lt;/span&gt;

&lt;span class="na"&gt;scenarios&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;0&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;mysql/mysql-suite.feature"&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And, in a mysql/mysql-suite.feature:&lt;/p&gt;

&lt;pre class="highlight"&gt;&lt;code&gt;Feature: Use the mysql test suite

    Scenario: We can select, update and check existence
        Given the row with "id" equal to "1" in table "some_table" should exist
        And the row with "id" equal to "1" in table "some_table" has "some_key" equal to "some_value"
        Then the row with "id" equal to "1" in table "some_table" should have "some_key" equal to "some_value"
        And the row with "some_key" equal to "some_value" in table "some_table" should exist

    Scenario: We can delete and check existence
        Given the row with "id" equal to "1" in table "some_table" does not exist
        Then the row with "id" equal to "1" in table "some_table" should not exist

&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And run it:&lt;/p&gt;

&lt;pre class="highlight"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;pyppet_theater mysql.yml
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You can also use the &lt;a href="https://cloud.docker.com/u/gpenverne/repository/docker/gpenverne/pyppettheater"&gt;docker image&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To know more about Pyppettheater, &lt;a href="https://github.com/gpenverne/pyppettheater"&gt;go to the repo!&lt;/a&gt;&lt;/p&gt;

</description>
      <category>gherkin</category>
      <category>dev</category>
      <category>testing</category>
      <category>python</category>
    </item>
    <item>
      <title>A docker image for your cordova and electron projects</title>
      <dc:creator>Grégoire</dc:creator>
      <pubDate>Thu, 13 Feb 2020 14:43:49 +0000</pubDate>
      <link>https://forem.com/gpenverne/a-github-template-for-your-cordova-and-electron-projects-599d</link>
      <guid>https://forem.com/gpenverne/a-github-template-for-your-cordova-and-electron-projects-599d</guid>
      <description>&lt;p&gt;Read the original article on &lt;a href="https://gkdv.net/github-template-for-html-cordova-and-electron-projects/"&gt;GKDV&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Each time I need to do a little personal android project (with a light angularjs),
I have to remember how to configure android environement, cordova packages, etc.&lt;/p&gt;


&lt;center&gt;
&lt;br&gt;
    &lt;img alt="cordova and electron docker image github template" src="https://res.cloudinary.com/practicaldev/image/fetch/s--ARfhku8r--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://gkdv.net/images/uploads/2020/02/bored-meme-59d95bc5678ba-300x210-300x210.jpg"&gt;&lt;br&gt;
&lt;/center&gt;

&lt;p&gt;And recently, I need to generate an electron app. 
However, cordova and electron use static html rendering logic: how to make it easier?&lt;/p&gt;

&lt;h1 id="using-docker"&gt;Using docker&lt;/h1&gt;

&lt;p&gt;I created a template repository on github: &lt;a href="https://github.com/gpenverne/electron-docker-project"&gt;electron-docker-project&lt;/a&gt;, which handles android and electron build, and can serve html files using nginx (because modern browsers deny ajax call on local environment).
It’s really simple to use, after you based your repository on this template:&lt;/p&gt;

&lt;h2 id="install"&gt;Install&lt;/h2&gt;

&lt;pre class="highlight"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;git clone git@github.com:gpenverne/electron-docker-project.git  
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;electron-docker-project  
&lt;span class="nv"&gt;$ &lt;/span&gt;make build &lt;span class="c"&gt;# Build the docker image  &lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;make &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="c"&gt;# Install dependencies  &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id="run---electron-gui"&gt;Run - electron gui&lt;/h2&gt;

&lt;pre class="highlight"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;make gui &lt;span class="c"&gt;# Launch the electron gui  &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id="generate-an-android-apk-cordova"&gt;Generate an android APK (cordova)&lt;/h2&gt;

&lt;pre class="highlight"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;make android &lt;span class="c"&gt;# Generate the android folders  &lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;make package &lt;span class="c"&gt;# Build android apk (and electron packages!)  &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id="serve-static-html-ui-nginx"&gt;Serve static html ui (nginx)&lt;/h2&gt;

&lt;pre class="highlight"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;make serve-html &lt;span class="c"&gt;# Will helpfull to dev  &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This docker image embed electron and android cordova dependencies: 
Now, you just have to edit the config.xml file to set the android app’s name, et voilà!&lt;/p&gt;



&lt;center&gt;
&lt;br&gt;
&lt;br&gt;&lt;br&gt;
    &lt;img alt="cordova and electron docker image github template" src="https://res.cloudinary.com/practicaldev/image/fetch/s--V7k95HFU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://gkdv.net/images/uploads/2020/02/so-much-awesome-meme.jpg"&gt;&lt;br&gt;&lt;br&gt;
&lt;/center&gt;

</description>
      <category>github</category>
      <category>docker</category>
      <category>electron</category>
    </item>
    <item>
      <title>How to totally remove a too big file from your github repository</title>
      <dc:creator>Grégoire</dc:creator>
      <pubDate>Fri, 25 Oct 2019 14:44:42 +0000</pubDate>
      <link>https://forem.com/gpenverne/how-to-totally-remove-a-too-big-file-from-your-github-repository-4aa9</link>
      <guid>https://forem.com/gpenverne/how-to-totally-remove-a-too-big-file-from-your-github-repository-4aa9</guid>
      <description>&lt;p&gt;Oops, you added a too big file on your github repository, and… no way to totally remove it from your history.  &lt;/p&gt;

&lt;p&gt;Read more on &lt;a href="https://gkdv.net/How-to-solve-too-big-file-on-github/"&gt;https://gkdv.net/How-to-solve-too-big-file-on-github/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>java</category>
    </item>
  </channel>
</rss>
