SeLion | #Functional Testing | Enabling Test Automation in Java

 by   paypal Java Updated: 5 months ago - v1.2.1-grid License: Apache-2.0

Download this library from

Build Applications

kandi X-RAY | SeLion REVIEW AND RATINGS

Enabling Test Automation in Java. SeLion builds on top of TestNG and Selenium to provide a set of capabilities that get you up and running with WebDriver in a short time. It can be used for testing web and mobile applications.

kandi-support
Support

  • SeLion has a low active ecosystem.
  • It has 261 star(s) with 232 fork(s).
  • It had no major release in the last 12 months.
  • On average issues are closed in 61 days.
  • It has a neutral sentiment in the developer community.

quality kandi
Quality

  • SeLion has no issues reported.

security
Security

  • SeLion has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

license
License

  • SeLion is licensed under the Apache-2.0 License. This license is Permissive.
  • Permissive licenses have the least restrictions, and you can use them in most projects.

build
Reuse

  • SeLion releases are available to install and integrate.
  • Deployable package is available in Maven.
  • Build file is available. You can build the component from source.
Top functions reviewed by kandi - BETA

kandi has reviewed SeLion and discovered the below as its top functions. This is intended to give you an instant insight into SeLion implemented functionality, and help decide if they suit your requirements.

  • Convert an object to an Object array .
  • Extracts the archive .
  • Creates the HTML file for the test .
  • Generate TBaseData for each test case
  • Processes the incoming SeLion request .
  • Called when a method is invoked .
  • Clicks on the element and waits for one element .
  • Generates the code generated from the given file .
  • Force the node to be shut down .
  • Determines the download to process .

SeLion Key Features

[1.2.0](http://search.maven.org/#search%7Cga%7C1%7Cselion) (Selenium 2.53.x based).

SeLion examples and code snippets

  • Documentation
  • Development version
  • Pass either a string or a value to use as a callback to get a value
  • composer multiple apps use path repo local and vcs on server

Documentation

mvn archetype:generate -B -DartifactId=Sample -Dversion=1.0.0 -DgroupId=com.mycompany.myproject \
 -DarchetypeGroupId=com.paypal.selion -DarchetypeArtifactId=SeLion-Archetype -DarchetypeVersion=1.2.0

Development version

Code - [Apache Software License v2.0](http://www.apache.org/licenses/LICENSE-2.0)

Documentation and Site - [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/deed.en_US)

Pass either a string or a value to use as a callback to get a value

class Test():
    def calculate_value(self):
        return 'test'

    def process1(self, x):
        """ Return x if it's a string or if not call it as a function """
        if isinstance(x, str):
            return x
        else:
            return x()

    def process2(self, x):
        """ Try to call x as a function and return the result, and if it doesn't work just return x """
        try:
            return x()
        except TypeError:
            return x

    def process3(self, x):
        """ Call x and return the result if it's callable, or if not just return x """
        if callable(x):
            return x()
        else:
            return x    

    def selion(self, data):
        # You can use self.process1, self.process2, or self.process3 here with
        # similar results
        return [self.process1(x['my_field']) for x in data]

    def do_stuff(self):
        c = self.selion([
            {
                'title': "mytitle1",
                'my_field': self.calculate_value,
                'other': 'other_value'
            },
            {
                'title': "mytitle2",
                'my_field': 'value_2',
                'other': 'other_value'
            },
        ])
        print(c)


test = Test()
test.do_stuff()

composer multiple apps use path repo local and vcs on server

"repositories" : [
    {
        "type" : "vcs",
        "url" : "git.foo.com:/path/to/my/dependent/repo.git"
    }
],
"autoload-dev": {
    "psr-4": {
        "My\\Dependent\\Repo\\": "/path/to/my/live/dev/install/of/this/repo"
    }
}
-----------------------
"repositories": {
    "local-libs": {
        "type": "path",
        "url": "../lib/*"
    },
    "vendor/foobar": {
        "type": "vcs",
        "url": "git@repository/url/to/foobar.git"
    },
    "vendor/bazqux": {
        "type": "vcs",
        "url": "git@repository/url/to/bazqux.git"
    }
}

COMMUNITY DISCUSSIONS

Top Trending Discussions on SeLion
  • Pass either a string or a value to use as a callback to get a value
  • composer multiple apps use path repo local and vcs on server
Top Trending Discussions on SeLion

QUESTION

Pass either a string or a value to use as a callback to get a value

Asked 2018-Jul-11 at 15:39

I'd like to call a function like this:

c = selion([{'title': "mytitle1",
             'my_field': 'value_1',
             'other': 'other_value'},
            {'title': "mytitle2",
             'my_field': 'value_2',
             'other': 'other_value'},])

The problem is that I would like 'my_field' to be sometimes a function to call back.

  • How to test, in the selion() function, if it's a string or a function and call it back?
  • if I want to pass in a function that is inside a class (something like self.calculate('client_x')), does it work out of the box like a normal function?

All in all I'd like this code to work:

class Test():
    def calculate_value(self):
        return 'test'

    c = self.selion([{'title': "mytitle1",
                      'my_field': self.calculate_value,
                      'other': 'other_value'},
                     {'title': "mytitle2",
                      'my_field': 'value_2',
                      'other': 'other_value'},])

ANSWER

Answered 2018-Jul-11 at 15:39

Any of the following methods (process1, process2, or process3) would work to test if the field is a string or function. (Results will vary between the methods if the field is neither, e.g. an integer.)

These will work regardless of whether the field is a method or ordinary function. If you want to pass values to the function, however, that will be more complicated and you may want to organise the program differently.

class Test():
    def calculate_value(self):
        return 'test'

    def process1(self, x):
        """ Return x if it's a string or if not call it as a function """
        if isinstance(x, str):
            return x
        else:
            return x()

    def process2(self, x):
        """ Try to call x as a function and return the result, and if it doesn't work just return x """
        try:
            return x()
        except TypeError:
            return x

    def process3(self, x):
        """ Call x and return the result if it's callable, or if not just return x """
        if callable(x):
            return x()
        else:
            return x    

    def selion(self, data):
        # You can use self.process1, self.process2, or self.process3 here with
        # similar results
        return [self.process1(x['my_field']) for x in data]

    def do_stuff(self):
        c = self.selion([
            {
                'title': "mytitle1",
                'my_field': self.calculate_value,
                'other': 'other_value'
            },
            {
                'title': "mytitle2",
                'my_field': 'value_2',
                'other': 'other_value'
            },
        ])
        print(c)


test = Test()
test.do_stuff()

Source https://stackoverflow.com/questions/51289003

QUESTION

composer multiple apps use path repo local and vcs on server

Asked 2018-Mar-29 at 08:58

I have multiple apps which share some repos.

In my local dev environment I have symlinked those repos via

{
    "repositories" : [
        {
            "type" : "path",
            "url" : "../../selion/importbundle"
        }
    ]
}

to my apps such that I can test repo changes instantly on all apps.

I run composer update locally push the app changes to a git repo and just install them on the server. but server side this is kind of annoying because

  1. I need to update the repos and the apps
  2. I need to update all apps

Is it possible to use path repos locally and vcs repos serverside?

ANSWER

Answered 2017-Nov-21 at 18:56

I've had this same issue. It would be nice to have a repositories-dev like we have require-dev. You could leave your repositories section intact (i.e., pointing to the VCS) and then add an autoload-dev section that overrides its derived path:

"repositories" : [
    {
        "type" : "vcs",
        "url" : "git.foo.com:/path/to/my/dependent/repo.git"
    }
],
"autoload-dev": {
    "psr-4": {
        "My\\Dependent\\Repo\\": "/path/to/my/live/dev/install/of/this/repo"
    }
}

So, composer install would pull the git repo of your library into vendor/ but then the autoloader would ignore it and use your live edits instead. Then when you deploy/build you do composer install --no-dev (which you should already be doing) and you'll get the git code. I'm not sure I'd recommend doing this unless you're the only person on the project though -- it would likely cause some issues with other developers.

Source https://stackoverflow.com/questions/47420144

Community Discussions, Code Snippets contain sources that include Stack Exchange Network

VULNERABILITIES

No vulnerabilities reported

INSTALL SeLion

You can use SeLion like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the SeLion component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

SUPPORT

Project Documentation and/or Project Website. Project Tests and/or Testing. Any open item from [GitHub Issues](https://github.com/paypal/SeLion/issues). Support for additional data formats such as CSV for data driven testing.

Implement SeLion faster with kandi.

  • Use the support, quality, security, license, reuse scores and reviewed functions to confirm the fit for your project.
  • Use the, Q & A, Installation and Support guides to implement faster.

Discover Millions of Libraries and
Pre-built Use Cases on kandi