teleren/devto huggingface dataset:
Data-QA Attribute! A better way to select elements for UI test automation
Tags: automation, qa, testing, testautomation
Published: 2019-08-04 18:23:30

I guess everyone who had to automate a web UI had the situation that it was a struggle to find a stable and study selector for some elements on a page. It is important to have stable selectors that the UI automated tests don’t fail if the structure of a page changes or the styling changes.

##Why not using ID’s or CSS class names?
ID’s and also css class names have another purpose than for the usage in UI automated tests. CSS classes are primarily used to style elements and they also can get uglified on the production page. ID’s have also another purpose and can also sometimes just change or they are not get implemented because they interfere with other functions on the page.

##Solution: Data-qa Attributes
Data-*Attributes are new in HTML 5. These HTML attributes enable us to create custom attributes on every HTML element. So the solution is to create ‘data-QA’ attributes for HTML elements. These attributes can be only used for the UI automated test and don’t interfere with any functions or purposes on the page.

###Examples for data-qa attributes
!["Code Example"](https://miro.medium.com/max/2000/1*wOSM8oCwce_trCWGVdywLQ.png)
Difference between GlobalScope.launch and launch
Tags: kotlin, coroutines
Published: 2019-08-04 17:49:25

Both coroutine builders `GlobalScope.launch {}` and `launch {}` are used to start a new coroutine. `GlobalScope.launch {}` starts a new coroutine in the 'global' scope and `launch {}` starts a new coroutine in a `CoroutineScope`. But what does this mean? 

To understand what is happening, we take a look at `runBlocking {}`. `runBlocking {}` will block execution (executing the next line of code after `runBlocking {}`) until all coroutines defined inside it's [scope][scope-vs-context] have been completed. For example in the following snippet, the line at `4.` will only execute when both coroutines defined inside `runBlocking {}` have been completed:


```kotlin
fun main() {
    println("1. Let's begin")
    runBlocking {
        launch { 
            delay(1000)
            println("3. coroutine ONE")
        }
        
        launch { 
            delay(500)
            println("2. coroutine TWO")
        }
    }
    
    println("4. Only when the children inside runBlocking complete, execution follows on this line")
}
```

[try it][runblocking-launch-try-it]


Let try running the same code with `GlobalScope.launch {}` instead of `launch {}`:

```kotlin
fun main() {
    println("1. Let's start with GlobalScope.launch {}")
    runBlocking {
        GlobalScope.launch {
            delay(1000)
            println("3. coroutine ONE")
        }

        GlobalScope.launch {
            delay(100)
            println("2. coroutine TWO")
        }
    }

    println("4. This line will execute even if the coroutines inside runBlocking did not complete.")
}
```
[try it][runblocking-globalscope-launch-try-it]

Now the coroutines inside `runBlocking {}`'s scope did not complete, and execution continued. What is happening here?

`runBlocking {}` defines a `CoroutineScope` where coroutines run in. However, the coroutines launched in the above example are running in a separate 'global' scope, where `runBlocking` has no control over. As far as `runBlocking {}` knows, there are no coroutines running inside it's scope. 



[runblocking-launch-try-it]: https://try.kotlinlang.org/#/UserProjects/ddsr38s4bjvt00cr7bagcebibj/1ejmadk62s9k2v6352ona5aq3f
[runblocking-globalscope-launch-try-it]: https://try.kotlinlang.org/#/UserProjects/t04ej0qngr4avtc3k09fc69gck/bn6ggp2ttmhig5unbagqlj8luq
[scope-vs-context]: [https://medium.com/@elizarov/coroutine-context-and-scope-c8b255d59055]
How can I add new html files to react app
Tags: react
Published: 2019-08-04 17:45:39

I am creating a new react app using create-react-app and I get all the setup but I don't know how to add new html files and render components to those files , is there a guide where I can check how to do it because I've searched on internet and asked on stackoverflow but no help yet ? Thanks  #myfirstpost

Edit : I don't want to have a single page app where I can change the content of the page , I want to render components to new pages , hope this makes it clear
Two type of functions and there difference
Tags: react, javascript
Published: 2019-08-04 17:45:34

I have one scenario where i am submiting the form data and alert the data , i am working on react js so the thing is on submit the code is 
onSubmit={ this.handlesubmit }
and here comes the issue which i dont understand 
when i declare function like this

handlesubmit(e){
        e.preventDefault()
        alert( ` ${this.state.inpUname} ${this.state.inpComment} ${this.state.profession} ` )
    }

it gives error , but when i declare function like that everything is ok

handlesubmit = (e) => {
        e.preventDefault()
        alert( ` ${this.state.inpUname} ${this.state.inpComment} ${this.state.profession} ` )
    }

i want to know the difference
# TestCases for Manual Software Testing.
Tags: testing, tutorial
Published: 2019-08-04 16:18:18

## :boom: What is it all about?
This project contains sample set of test cases for manual testers to help them save time for writing manual test cases.


## :golf: Why was this project created?
It is always a tedious and boring task to write test cases, which takes most of the time of software testing. Hence, I decided to make generic test cases for the functionality majorly used in software testing so anyone can just download the copy and use it directly in their projects and save their time wasted in writing the generic test cases.


## :bulb: Sample Test Cases are added for the following:
- Generic field level test cases for Textbox, Dropdown-box/Multi-Dropdownbox, Checkbox, Radio button, Submit/Save/Cancel button and Date fields,
- Sample Test cases for Export Functionality.
- Sample Test cases for Import Functionality.
- Sample Test cases for Testing reports.
- Sample Test cases for testing Mobile apps.
- Test Planning Checklist.

Check out the following link for more details and for downloading the templates and testcases:

https://github.com/mfaisalkhatri/Manual_Testing
Is this normal? I am kinda freaked out!
Tags: experience
Published: 2019-08-04 15:57:51

![](https://thepracticaldev.s3.amazonaws.com/i/th8x78gd9gf7yvxp31cr.png)

First of all, thank you for all your reactions and especially for the people who chose to follow me. I am flattened at this marvelous and wonderful community which is very helpful and above all inclined highly towards positive promotion and support to its users. Never have i before experienced such a response.

I joined on 2 Aug, almost 2 days back, and having almost 150+ people following me is really like freaking me out a bit. I just thought i'd write to the community.
Get current time in 12 hours AM PM format in React Native Android iOS
Tags: reactnative, android, ios, javascript
Published: 2019-08-04 14:36:58

---
title: Get current time in 12 hours AM PM format in React Native Android iOS
published: true
description: Get current time in 12 hours AM PM format in React Native Android iOS
tags: #reactnative #android #ios #js
---

Source : <a href="https://www.skptricks.com/2019/05/react-native-create-live-digital-clock-using-local-system-time.html" > Get current time in 12 hours AM PM format in React Native Android iOS</a>

This tutorial explains how to create live digital clock and get current system time using local system time in react native. You may have seen this feature in your android or ios mobile lock screen and here we are going create similar implementation to get current system time in digital clock.


<img src="https://1.bp.blogspot.com/-gac-rfLXipc/XO4ciOGz-pI/AAAAAAAAC4Q/VQyAdKcvtjoM8s03Z1JhFEStIg2jqFnkQCLcBGAs/s400/react-native-create-live-digital-clock-using-local-system-time.jpg" />

<a class="ytp-title-link yt-uix-sessionlink" target="_blank" data-sessionlink="feature=player-title" href="https://www.youtube.com/watch?v=bnFXKcQDEUk">React Native Create live Digital Clock using Local System Time</a>

<a href="https://www.skptricks.com/2019/05/react-native-create-live-digital-clock-using-local-system-time.html" > Click here to read more...</a>
Free responsive HTML email templates on GitHub
Tags: github, html
Published: 2019-08-04 14:36:21

---
title: Free responsive HTML email templates on GitHub 
published: true
description: Free responsive HTML email templates on GitHub 
tags: github, opensource, html
---

Feel free to use HTML templates as you want.
I'll be adding more new templates in the future.

{% github mysigmail/html-email-templates %}
Daily Challenge #32 - Hide Phone Numbers
Tags: challenge
Published: 2019-08-04 14:33:09

---
title: Daily Challenge #32 - Hide Phone Numbers
published: true
series: Daily Challenge
description: Write a function that will hide the last 6 digits of a US (or other) phone number
tags: challenge
---

For this [challenge](https://www.codewars.com/kata/5953e4a29e93cef2e90000aa), write a function that encrypts phone numbers. The method should hide the last six digits of each phone number.

>**Example 1** (Using US phone number)
*IN:* `201-680-0202` => *OUT:* `201-6XX-XXXX`

You can also have the code check the validity of the phone number's format. 

>**Example 2**
*IN:* `145-201-680-0202` => *OUT:* `false`

Feel free to apply this challenge to phone numbers outside the USA as well.

Good luck!

---
_This challenge comes from user otrebor6. Thank you to CodeWars, who has licensed redistribution of this challenge under the 2-Clause BSD License!_

_Want to propose a challenge for a future post?  Email **yo+challenge@dev.to** with your suggestions!_
You're not worth hiring unless...
Tags: webdev, career, discuss
Published: 2019-08-04 14:08:18

---
title:  You're not worth hiring unless...
published: true
description: 
tags: webdev, career, discuss
cover_image: https://thepracticaldev.s3.amazonaws.com/i/z1kzqba3cig3vnt7ywci.png
---

## The Junior Developer
A junior developer who said I was the smartest person in the company and frequently asked for my help once told me if someone can't transverse a binary tree and write a bubble sort they're not worth hiring. I was shocked because I can do neither of those things from memory. What happens if this person becomes a hiring manager?

## The Startup CTO
 A company wanted to hire me. They asked if I could write Larvarel middleware, VueJS + Typescript.  I said I hadn't built anything recent in that stack, but I've built 40 apps in the last decade, so I have comparable code that shows it would be trivial for me to become proficient. If it wasn't 1-to-1 with their stack, they didn't believe I could do it. 

## Qualifiers
There are ways to hack around these problems (maybe a future post I should do). When people say there are lots of technical jobs, but people are not qualified, they need to re-examine their qualifiers.

## Share your Story

Have you ever felt crazy because the qualifiers don't make sense? Let us hear it.
PLEAC - another good language comparison site
Tags: learning, programming, languages
Published: 2019-08-04 13:51:02

[PLEAC](http://pleac.sourceforge.net/) is the Programming Language Examples Alike Cookbook. 

>  Following the great Perl Cookbook (by Tom Christiansen & Nathan Torkington, published by O'Reilly ...) which presents a suite of common programming problems solved in the Perl language, this project aims to implement the solutions in other programming languages.

> If successful, this project may become a primary resource for quick, handy and free reference to solve most common programming problems using various programming languages, and for comparison on ease-of-use and power/efficiency of these languages. 

If your languages isn't there, they invite you to add it.
RosettaCode - see how other programmers do it
Tags: programming, languages, learning
Published: 2019-08-04 13:27:25

I've been hanging out a [RosettaCode](http://rosettacode.org/wiki/Rosetta_Code) for years and have completed many of the challenges in many languages. I've even created some challenges. 

Today I created a [draft task](http://rosettacode.org/wiki/Teacup_rim_text). I've described this way:

> On a set of coasters we have, there's a picture of a teacup. On the rim of the teacup the word "TEA" appears a number of times separated by bullet characters. It occurred to me that if the bullet were removed and the words run together, you could start at any letter and still end up with a meaningful three-letter word. So start at the "T" and read "TEA". Start at the "E" and read "EAT", or start at the "A" and read "ATE".

> That got me thinking that maybe there are other words that could be used rather that "TEA". And that's just English. What about Italian or Greek or ... um ... Telugu.

> So here's the task: from a web accessible or locally accessible word source, iterate through each word of length 3 or more. With each word, peel off the first letter and put it at the end. Check if the word exists. If it does, keep going with the next letter, repeating the process for as many letters as there are minus one. If all of the words exist store the original word. List the words that survive the process at the end. Optionally list all their variants. 

I invite you to respond to the task (and any of the others on the site) in your language. If that language is already represented, present a better solution. And if your language isn't represented, add it! I just added [Lychen](https://github.com/axtens/Lychen).

By the way, being a draft task, the requirements are fluid and may change over time. You have been warned!
How to wait for a container to be ready?
Tags: docker, devops, webdev
Published: 2019-08-04 13:19:26

---
title: How to wait for a container to be ready?
published: true
description: How to wait for a container to be ready
tags: docker, devops, webdev
---

Originally published on my [blog](https://blog.selahattinunlu.com/2019-08-04-how-to-wait-for-a-container-to-be-ready)

---

### The Problem

First of first, I don't have many experiences on Docker. I'm just trying to dockerize one of my side-project and I thought can learn about Docker. Although I did not deploy it yet, it seems great to use it in development at least. Anyway, let's talk about the main subject.

If you've worked with Docker before, you know that some containers might depends on to the others. For example, your backend applications might depends on to the MongoDB (just like in my case). In this case, backend application must wait until the mongo container is runned. 

There are a couple of ways to set that dependencies in your configuration files. `depends_on` is one of them, and I was using it in my application. Everything were working perfectly at the beginning but today I've encountered with a problem! My application was not connecting to the MongoDB. But how? It was working last week and I did not do anything! What the hack?

Then, I've checked the logs and realized that the MongoDB was being ready to wait connections after my backend application is run! But I had used `depends_on` configuration! I've done a quick google search and understood the problem. 

--- 

**depends_on** only cares about if the container is run or not. So, does not matter whether mongodb is ready for connections. Aha! It's so sensible. How could docker knows if it's ready or not?

---

### The Solution

I've searched the solution as well and found a couple of solutions. I'm gonna tell you the best one for me.

The solution is **wait-for-it.sh** [Here is the repository](https://github.com/vishnubob/wait-for-it)

It's a bash script to wait on the availability of a TCP host and port. You can find that description at its repository 'It is useful for synchronizing the spin-up of interdependent services, such as linked docker containers.'

#### How to apply the solution

- I've copied `wait-for-it.sh` file into my app folder.

- Then add those lines into Dockerfile:

```bash
COPY wait-for-it.sh /usr/wait-for-it.sh
RUN chmod +x /usr/wait-for-it.sh
```

- And the final step, I've changed application command in docker-compose.yml:

```bash
app:
    container_name: backend
    restart: always
    build: .
    volumes:
        - .:/usr/src/app
        - /usr/src/app/node_modules
    ports:
        - "3030:3030"
        - "9229:9229"
    depends_on:
        - mongo
    command: bash -c "/usr/wait-for-it.sh --timeout=0 mongo:27017 && npm run dev"
```

That's all! My backend application waits until mongodb is ready for connections. End of the story! :)
Hello, Dev.to
Tags: ruby, javascript, elixir, helloworld
Published: 2019-08-04 13:17:52

---
title: Hello, Dev.to
published: true
description: Testing out Dev.to
tags: ruby, javascript, elixir, hello world
---

I have been a dev for ~5 years now. I went from physics major to The Iron Yard bootcamp grad and 1 month later I was a developer. A few weeks ago I realized I didn't have a "portfolio". So, I wanted to find a way to get my thoughts about deving out to the world. 

I'm not a great writer (hence physics major :D ) so blogs never really appealed to me, but why not give it a shot. I thought about creating a personal site, but then, I was like "why not just use dev.to + twitter + youtube as my blog?" Seems simple enough. 8) 

I'm a Ruby on Rails and EmberJS dev by trade, but over the next few months I'm going to dive into the world of Elixir. Let's see how this journey turns out. 

Jeremy aka @basicBrogrammer
Collab: Angular Based Open Source CMS?
Tags: angular, javascript, discuss, webdev
Published: 2019-08-04 12:49:58

When I was in the times of PHP, there was Wordpress, Joomla, Magento and Frameworks like SlimPHP, Laravel and much more but what about Angular/Node.

## Whats in my mind?
 1. Easy Themes
 2. Easy Plugins
 3. Serverless Deployment
 4. One Click Install

I did find some CMS like butterCMS for angular and stuff, but it all just seems a great oppurtunity, if some people can collaborate and perhaps create a new world within this world.

Lets see how everybody reacts.

I think getting together would be a big start in making things possible.
PHP vs Node?
Tags: javascript, productivity, beginners, docker
Published: 2019-08-04 11:44:37

I have done quite many projects with clients in PHP, but now I have moved away from PHP to Node.

I would like to know what do you guys have to say about it.

## My Opinion About PHP
It is a great powerful language to make your programming concepts very clear and how your code will translate, the language is based on original core concepts and as a beginner, i do highly recommend it.

## Node
Very Fast, Highly performative, a bit complex for beginners, and it has its own new concepts to embark upon. It is a versatile language and i think the demand for todays market.
Game Development Postmortem: TallerTower
Tags: gamedev
Published: 2019-08-04 11:17:04

What went right: The flow of gameplay from floor to floor of the tower, keeping extra grinding to a minimum, worked as intended.

What did NOT go right: Sure, you do not have to grind much, but you spend so much time searching for the exit that you get more money than you can ever spend before long. The weird dungeon layouts do not help matters, either.

One of my more interesting experiments made with "Diane", a homemade game engine in the Java language - used for plenty of other games. I even made a family tree of them...

<pre>  [ROOT]
    |
    |----------------------------------------------------------------
    |                                                                \
Maze Runner ---------------------------------------------            |
    |           \               \                        \           |
Fantastle  Dungeon Diver    LaserTank (original)  Maze Runner 2  TAP (Text Adventure
    |           |               |                                    Parser)
 Mazer5D   Dungeon Diver 2  LaserTank Remix
    |           |               |
BrainMaze  Dungeon Diver 3  LaserTank EE (Enhanced Edition) (inactive)
    |           |
GoldHunt   Dungeon Diver 4 --------------------------------
                |                         \                \
           DDRemix / DD5                Katie     Dynamic Dungeon (new)
                |                         |                |
           Dynamic Dungeon (old) / DD6  Rachel    Twisted Trek (inactive)
                |
              Gemma
                |
            TallerTower (focus of this post)
                |
        Chrystalz (inactive)</pre>
Is Neve Pro really good to make wonderful WordPress site?
Tags: wordpress, nevepro, wordpressthemerevi
Published: 2019-08-05 09:02:17

---
title: Is Neve Pro really good to make wonderful WordPress site?
published: true
tags: WordPress,neve pro,wordpress theme revi
canonical_url: https://kevinhq.com/is-neve-pro-really-good-to-make-wonderful-wordpress-site/
---

I used the Neve Pro theme since two months ago. I tried this because I saw ThemeIsle was offering a free Neve Pro license for one year at that time. Initially, I grabbed that offer to give it a try. Now I realize this theme fits most of my needs. Is it good? Let’s see.… [Continue reading »Is Neve Pro really good to make wonderful WordPress site?](https://kevinhq.com/is-neve-pro-really-good-to-make-wonderful-wordpress-site/) ![](http://feeds.feedburner.com/~r/kevinhq/~4/8je-1VkqjWI)
Stevey's Blog Rant against The Church of Agile
Tags: management, productivity
Published: 2019-08-04 10:48:11

Just finished reading Steve Yegge's rant against Agile. It's a work of Art, and the man is a gifted comedy writer 😂 The best part is how you get like... Louis CK level humour but with tons of programmer in-jokes!

My favourite part:

```
The Perl folks have this Perl Haiku competition each year. 
It's a nifty idea, and it's pretty amazing that 
you can write useful seventeen-syllable programs.

I tried it with Java once, and produced a valid Java haiku:

ArrayList<int> myListOfInt = new ArrayList<int>();

which, spoken aloud, reads:

ArrayList of Int
my list of int, equals new
ArrayList of Int
```

My sides.

Give it a go if you got some free time 😄 https://steve-yegge.blogspot.com/2006/10/egomania-itself.html?m=1

\#ItsOkayToSayNOToAgile
Coteafs-Selenium
Tags: java, github
Published: 2019-08-04 10:36:03

##Selenium WebDriver wrapper framework for writing clean and maintainable tests.

### :question: What is this Framework about?

This is a Selenium WebDriver wrapper Framework which enables robust, maintainable and easy to write test scripting. _**It supports latest Selenium WebDriver 4.0 (Alpha)**_ and is ready for main Selenium upgrade.

### :bulb: What features does this framework offer?

Nobody uses anything without knowing what it offers. Some of the key features which this framework offers are as follows:

- Latest Selenium WebDriver 4.0 (Alpha 2)
- On-demand highlighting of Elements
- On-demand delay of test execution by allowing predefined delays
- On-demand headless mode
- Parallel execution of tests on different browsers
- Support Chrome, Safari, Firefox, IE and Edge
- CI / CD ready

####Checkout the following link for more details:
https://github.com/WasiqB/coteafs-selenium
Flutter representation of a Social App Concept.
Tags: flutter, android, ios, dart
Published: 2019-08-04 09:43:00

Few weeks ago, i made a Social app UI Kit in flutter and it's on Github.
        ![Preview](https://github.com/JideGuru/FlutterSocialAppUIKit/raw/master/ss/2.png)

Check it out [here](https://github.com/JideGuru/FlutterSocialAppUIKit).

Also the check out the [Medium article](https://medium.com/@jideguru/building-a-social-app-ui-with-flutter-af3d2317dc10?source=---------2------------------)

Thanks.
Who is in space now?
Tags: rest, api, bash, space
Published: 2019-08-04 09:24:44

```bash
$ curl --silent http://api.open-notify.org/astros.json | 
  jq --raw-output .people[].name

Alexey Ovchinin
Nick Hague
Christina Koch
Alexander Skvortsov
Luca Parmitano
Andrew Morgan
```