Overview
Comment:Plus de tests
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: ceaf3d311a2ad5fa9c0794a0ba584b93e005a4f4
User & Date: bohwaz on 2014-04-01 16:39:34
Other Links: manifest | tags
Context
2014-04-01
16:56
Autres tests check-in: b27152664d user: bohwaz tags: trunk
16:39
Plus de tests check-in: ceaf3d311a user: bohwaz tags: trunk
16:16
Tests JS check-in: 92cffd491b user: bohwaz tags: trunk
Changes

Added tests/10-login.js version [9e07ca2ad5].



























































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*jshint strict:false*/
/*global CasperError, casper, console, phantom, require*/

casper.test.begin('Login', 3, function suite(test) {
    casper.start("http://localhost:8080/admin/login.php", function() {
        test.assertTitle("Connexion", "Page de connexion");
        test.assertExists('form', "Formulaire présent");
        this.fillSelectors('form', {
            '#f_id':                "ada@demo.garradin.eu",
            '#f_passe':             "Garradin c'est chouette",
        }, false);
        this.click('form input[type=submit]');
    });

    casper.then(function() {
        if (this.getCurrentUrl().match(/\/$/))
        {
            test.pass("Connexion réussie.");
        }
        else
        {
            test.error(this.fetchText('p.error'));
        }
    });

    casper.run(function () {
        test.done();
    });
});

Added tests/11-add-member.js version [aa4cd388a9].







































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*jshint strict:false*/
/*global CasperError, casper, console, phantom, require*/

casper.test.begin('Login', 3, function suite(test) {
    casper.start("http://localhost:8080/admin/membres/ajouter.php", function() {
        test.assertTitle("Ajouter un membre", "Page OK");
        test.assertExists('form', "Formulaire présent");
        this.fillSelectors('form', {
            '#f_nom':               "Gaston Lagaffe",
            '#f_email':             "gaston@demo.garradin.eu",
            '#f_adresse':           "42 rue Spirou",
            '#f_ville':             "Bruxelles",
            '#f_code_postal':       "3001",
            '#f_pays':              "BE",
            '#f_telephone':         "01 02 03 04 05",
        }, false);
        this.click('#password_suggest');
        this.click('form input[type=submit]');
    });

    casper.then(function() {
        if (this.getCurrentUrl().match(/fiche\.php\?id=/))
        {
            test.pass("Ajout réussi.");
        }
        else
        {
            test.error(this.fetchText('p.error'));
        }
    });

    casper.run(function () {
        test.done();
    });
});

Modified tests/run.sh from [a9d9725c51] to [c2ecdca281].

18
19
20
21
22
23
24


25
26

27
28
29
30


31

32


33
    cd $TESTDIR
    fossil clone https://fossil.kd2.org/garradin/ garradin.fossil
    fossil open garradin.fossil
    sh tools/setup_dependencies.sh
    cd $SCRIPTPATH
fi



rm -rf $TESTDIR/src/cache
rm -rf $TESTDIR/src/*.sqlite


php -S localhost:8080 -t $TESTDIR/src/www &
PHP_PID=$!



$CASPERJS test *.js




kill $!







>
>


>




>
>
|
>

>
>

18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
    cd $TESTDIR
    fossil clone https://fossil.kd2.org/garradin/ garradin.fossil
    fossil open garradin.fossil
    sh tools/setup_dependencies.sh
    cd $SCRIPTPATH
fi

if [ "$1" != "--no-install" ]
then
rm -rf $TESTDIR/src/cache
rm -rf $TESTDIR/src/*.sqlite
fi

php -S localhost:8080 -t $TESTDIR/src/www &
PHP_PID=$!

if [ "$1" != "--no-install" ]
then
	$CASPERJS test 0*.js
fi

$CASPERJS --cookies-file=$TESTDIR/cookies.txt test 1*.js

kill $!