Record browser tests for Laravel Dusk chromedriver - automated-tests

I am writing automated tests for a PHP Laravel application with Dusk.
I am writing tests in tests/Browser/ folder this way:
$this->browse(function (Browser $browser) {
$browser->visit( '/admin' )
->type('login', 'mylogin')
->type('password', 'mypassword')
->press('Sign In')
->pause(1000)
->assertSee('Welcome on admin dashboard !');
->visit( '/admin/products/new' )
->type('name', 'Product 1')
...
My question is: Is there a way to generate this files ? I need something like a browser plugin. I will navigate and create some products on my application. Then i want to replay this scenario in my tests.
Is it possible ?
Thanks

Laravel Test Tools extension could assist you.
Github repo: https://github.com/mpociot/laravel-testtools
Chrome extension: https://chrome.google.com/webstore/detail/laravel-testtools/ddieaepnbjhgcbddafciempnibnfnakl?hl=en
This will help you build up tests without manually writing the code for each test.

Related

cloud composer airflow plugin usage

I am just starting with airflow plugins and am a bit confused.
I am running it as a managed service using Cloud Composer on GCP (composer-1.13.4-airflow-1.10.12)
I wrote the plugin as per the docs but don't really know how to 'use' it
class TestAppBuilderBaseView(AppBuilderBaseView):
#expose("/test")
def test(self):
return self.render("test_plugin/test.html", content="Hello Starlight!")
v_appbuilder_view = TestAppBuilderBaseView()
v_appbuilder_package = {"name": "Test View",
"category": "Test Plugin",
"view": v_appbuilder_view}
class AirflowTestPlugin(AirflowPlugin):
name = "test_plugin"
appbuilder_views = [v_appbuilder_package]
Cloud composer UI kick me over to https://[alpha-numeric].appspot.com/admin/ but I can't seem to find the exposed route for my apps plugin. I’ve tried https://[alpha-numeric].appspot.com/admin/test and https://[alpha-numeric].appspot.com/test
I can get a menu link plugin to show up so I know that i am uploading the files to correct location in the storage bucket.
WHAT AM I MISSING HERE?
Any help would be appreciated, thanks :)
I'm not sure I understood exactly your question, but if you want any sort of webserver plugin to work, you must disable dag serialization as explained here.
After the lengthy Composer restart, it'll work both in the flask based and appbuilder based ui. source

Running Chimp with Meteor

Installed Chimp globally and locally for my app. Created features directory at the root of my app. Put in a feature file insertContract.feature with the following scenario.
Feature: Input contact information
As a contract admin
I want to input contact information
So that I can save it in a database
#watch
Scenario: Go to the contract insert page
Given I have visited Contract Insert page
Then I see an input "supplierName"
Ran chimp.
chimp --ddp=http://localhost:7001 --watch
Chimp says it is running and watching tages #watch, #focus, #dev. But it does not pick up anything from the feature file.
Sudis-MacBook-Pro:contract tupun$ chimp --ddp=http://localhost:7001 --watch
[chimp] Watching features with tagged with #dev,#watch,#focus
[chimp] Running...
It is supposed to provide me with the stubs for step-definition. What am I doing wrong?
I just started to use chimp too, and i use #focus instead #watch for get the definitions
I hope, this helpt you.
cheers.

Auto-loading your Kohana project for unit testing in Codeception

I am very much new to Kohana and Codeception world. I was exploring how to do testing in kohana using codeception.
I was able to run acceptance test. But now I want to create my Unit test for my demo app that has only sign and signup functionality.
How should I load the required files or the application instance which I will be using in the unit test.
Like I need to check if "Controller_Login" class exists. And then within this controller if "action_login" method exists or not.
I have gone through the Codeception documentation and it says that you need to auto-load your project in the unit/_bootstrap.php file.
So, how should I auto-load my project. Could you please guide me.
For unit test I have written this simple test
public function testMe()
{
$users = new User;
$this->assertInstanceOf('User', $users);
}
But when I run this it gives me error on console that "Class 'User' not found".
How should I auto-load my project please guide me.
Writing unit test for you app using Codecpetion you need to follow these points.
You need to load all your app in Codecpetion. So, that your test can easily access your classes.
There is one _bootstrap.php file at the root in test folder which Codecpetion creates once you bootstrap Codecpetion.
In this file you need to load your app.
For example I have done it like this to load my application folder.
define('APPPATH', realpath('application').'/');
So like this now you can create a unit test and access any class you would like to access.

Path variables not working on 0.6.5 e.g. METEOR_SETTINGS

i cannot get it working after i updated to 0.6.5.
I created a new meteor project.
I have a start.sh script that looks like this.
export METEOR_SETTINGS=$(cat ./settings.json)
meteor
settings.json:
{
"public":{
"bla":"blup"
}
}
Meteor.settings on the client is undefined. It works if i add the settings json file via "--settings", but unfortunately this is not what i need.
The PORT environment variable or NODE_ENV also does not work for me.
Adding some random stuff like "export MY_ENV_VAR=foo" however works.
Am i missing s.th.? It all worked well before. I would really appreciate your help.
Thx!
(also created an issue: https://github.com/meteor/meteor/issues/1381)
If you are trying to test your meteor app locally (dev mode) or you want to deploy your app to the Meteor hosting, then just pass the file path as settings param:
meteor --settings settings.json
In case of running from bundle on your own server, then you need the environment variable.
Docs.

Using flash builder 4.5 for php wizard for remote object

I'm fairly new to Flex\AS3
I'm using flash builder 4.5 for php and I'm trying to connect to my DB via remote objects.
I'm following adobes instructions as listed here:
http://help.adobe.com/en_US/flex/accessingdata/WSbde04e3d3e6474c4-668f02f4120d422cf08-7ffe.html#WSbde04e3d3e6474c4-668f02f4120d422cf08-7ffa
I've created the php service, and successfully finished the wizard.
I've tested my service with the Test tool and it is indeed returning my results.
My problem is that it seems that flash builder didn't create the service's files(super+base) at all. For example, when I drag the service into a dropdown component I get an error saying that the service component can't be found.
Does anyone know this issue happens? how can the test tool work if the service classes don't exist?
Thanks in advance,
Ravid
The problem was that I didn't checkout the files before using the wizard so flash builder didn't have write permissions on the files and therefore didn't create the necessary files.
once he had the write permissions - everything worked just fine

Resources