PHPackages                             portrino/codeception-yandex-module - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. portrino/codeception-yandex-module

AbandonedArchivedLibrary

portrino/codeception-yandex-module
==================================

Provides validation of structured data via yandex API

0.4.0(8y ago)3100[1 issues](https://github.com/portrino/codeception-yandex-module/issues)PHP

Since May 12Pushed 8y ago4 watchersCompare

[ Source](https://github.com/portrino/codeception-yandex-module)[ Packagist](https://packagist.org/packages/portrino/codeception-yandex-module)[ RSS](/packages/portrino-codeception-yandex-module/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependencies (6)Versions (8)Used By (0)

Codeception Yandex Module
=========================

[](#codeception-yandex-module)

[![Build Status](https://camo.githubusercontent.com/2d5296c5ded26d9721aaa2da45c9634a68de9ef17d224084782d18b84c98a4bb/68747470733a2f2f7472617669732d63692e6f72672f706f727472696e6f2f636f646563657074696f6e2d79616e6465782d6d6f64756c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/portrino/codeception-yandex-module)[![Maintainability](https://camo.githubusercontent.com/3b6213535660a8a41e3f9733e65492956f53a2681698294ee07c9deeb6236916/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f66333439356565626235386366386235303036352f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/portrino/codeception-yandex-module/maintainability)[![Test Coverage](https://camo.githubusercontent.com/254f21427f00d826e16a5cd7b471c8459c6f1d0329928cd1d055c8ea4838b3c6/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f706f727472696e6f2f636f646563657074696f6e2d79616e6465782d6d6f64756c652f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/portrino/codeception-yandex-module/coverage)[![Test Coverage](https://camo.githubusercontent.com/654864465ba4bdd867ce78a56ce5e1ec69bc259e77f66ea374e0027835b9eba3/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f66333439356565626235386366386235303036352f746573745f636f766572616765)](https://codeclimate.com/github/portrino/codeception-yandex-module/test_coverage)[![Issue Count](https://camo.githubusercontent.com/4054e0d2337cd61950f28d74bdbc495c589c341af2f29c74bd193a02e1f808a1/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f706f727472696e6f2f636f646563657074696f6e2d79616e6465782d6d6f64756c652f6261646765732f69737375655f636f756e742e737667)](https://codeclimate.com/github/portrino/codeception-yandex-module)[![Latest Stable Version](https://camo.githubusercontent.com/67b339001acfc451bcd3d653ec0473600de27bec07bf8e3a400e0cf13f1ba592/68747470733a2f2f706f7365722e707567782e6f72672f706f727472696e6f2f636f646563657074696f6e2d79616e6465782d6d6f64756c652f762f737461626c65)](https://packagist.org/packages/portrino/codeception-yandex-module)[![Total Downloads](https://camo.githubusercontent.com/1d69756e98f664f5727052d44fc12a920b699e321bf80eb6afffa591637693ac/68747470733a2f2f706f7365722e707567782e6f72672f706f727472696e6f2f636f646563657074696f6e2d79616e6465782d6d6f64756c652f646f776e6c6f616473)](https://packagist.org/packages/portrino/codeception-yandex-module)

This package provides validation of responses via [**Structured data validator API**](https://tech.yandex.com/validator/)from Yandex. You can automatically check if your embedded [structured data](https://developers.google.com/search/docs/guides/intro-structured-data)markup (aka semantic markup) is correct based on the current vocabularies like [schema.org](http://schema.org/).

> To transmit data to the API, you specify the HTML code or URL of the page. After completing validation, the API outputs the structured data extracted from the page in JSON format, &gt; along with the codes of any errors detected. The following syntaxes are currently supported: JSON-LD, RDFa, microdata, and microformats.

*Source: *

With this module you are able to automate tests for semantic data validation in your cests via codeception. You save time during development of new features, because you do not have to copy your markup manually into the [structured data testing tool](https://search.google.com/structured-data/testing-tool) or [structured data validator](https://webmaster.yandex.com/tools/microtest/) when checking if some new feature or bugfix break your semantic markup.

You also can use this module for automating structured data validation for large quantities of pages.

Installation
------------

[](#installation)

You need to add the repository into your composer.json file

```
    composer require --dev portrino/codeception-yandex-module
```

Usage
-----

[](#usage)

You can use this module as any other Codeception module, by adding 'Yandex' to the enabled modules in your Codeception suite configurations.

### Enable module and setup the configuration variables

[](#enable-module-and-setup-the-configuration-variables)

- After registering you can get the `apiKey` here: **
- The `url` could be set in config file directly or via an environment variable: `%BASE_URL%`

```
modules:
    enabled:
        - Yandex:
            depends: PhpBrowser
            url: ADD_YOUR_BASE_URL_HERE
            apiKey: ADD_YOUR_API_KEY_HERE
```

Update Codeception build

```
  codecept build
```

### Implement the cept / cest

[](#implement-the-cept--cest)

```
  $I->wantToTest('If structured data for page is valid.');
  $I->amOnPage('foo/bar/');

  $I->seeResponseCodeIs(\Codeception\Util\HttpCode::OK); // 200

  // validate all
  $I->seeResponseContainsValidStructuredDataMarkup();
  // validate only JSON+LD
  $I->seeResponseContainsValidJsonLdMarkup();
  // validate only Microdata
  $I->seeResponseContainsValidMicrodataMarkup();
  // validate only Microformat
  $I->seeResponseContainsValidMicroformatMarkup();
  // validate only Rdfa
  $I->seeResponseContainsValidRdfaMarkup();

  // grab the data array from Yandex API response
  // @see: https://tech.yandex.com/validator/doc/dg/concepts/response_standart-docpage/
  $data = $I->grabStructuredDataFromApiResponse()['json-ld'];

  // grab the data from Yandex API response via jsonPath
  // !Important: All chars like . // / and - are replaced by _ to make jsonPath working!
  $I->assertEquals(
      'foo.com',
      $I->grabStructuredDataFromApiResponseByJsonPath('json_ld.0.http___schema_org_name.0._value')[0]
  );

```

### Methods

[](#methods)

#### seeResponseContainsValidStructuredDataMarkup()

[](#seeresponsecontainsvalidstructureddatamarkup)

Validates the current response from `$I->amOnPage('/foo/bar/');` against the structured data validator API and checks all supported formats like: **JSON-LD, RDFa, microdata, and microformats**.

```
  $I->seeResponseContainsValidStructuredDataMarkup();

```

#### seeResponseContainsValidJsonLdMarkup()

[](#seeresponsecontainsvalidjsonldmarkup)

Validates the current response from `$I->amOnPage('/foo/bar/');` against the structured data validator API and checks only the data which is in **JSON-LD** format.

```
  $I->seeResponseContainsValidJsonLdMarkup();

```

#### seeResponseContainsValidMicrodataMarkup()

[](#seeresponsecontainsvalidmicrodatamarkup)

Validates the current response from `$I->amOnPage('/foo/bar/');` against the structured data validator API and checks only the data which is in **microdata** format.

```
  $I->seeResponseContainsValidMicrodataMarkup();

```

#### seeResponseContainsValidMicroformatMarkup()

[](#seeresponsecontainsvalidmicroformatmarkup)

Validates the current response from `$I->amOnPage('/foo/bar/');` against the structured data validator API and checks only the data which is in **microformat** format.

```
  $I->seeResponseContainsValidMicroformatMarkup();

```

#### seeResponseContainsValidRdfaMarkup()

[](#seeresponsecontainsvalidrdfamarkup)

Validates the current response from `$I->amOnPage('/foo/bar/');` against the structured data validator API and checks only the data which is in **RDFa** format.

```
  $I->seeResponseContainsValidRdfaMarkup();

```

#### grabStructuredDataFromApiResponse()

[](#grabstructureddatafromapiresponse)

Grab the structured data from the current response and it returns it as array. Please have a look at [https://tech.yandex.com/validator/doc/dg/concepts/response\_standart-docpage/](https://tech.yandex.com/validator/doc/dg/concepts/response_standart-docpage/)for information about the standard response format of the yandex API.

```
  $data = $I->grabStructuredDataFromApiResponse();

```

#### grabStructuredDataFromApiResponseByJsonPath()

[](#grabstructureddatafromapiresponsebyjsonpath)

**Experimental!!!**

Grab the structured data from the current response by jsonPath query syntax with the help of [JSONPath PHP Package](https://github.com/FlowCommunications/JSONPath). All "special" chars like:

- .
- //
- /
- -
- :
- @
- '
- \\

are replaced in json response from yandex structured data validator API by \_ to make jsonPath working!

```
  $data = $I->grabStructuredDataFromApiResponseByJsonPath('json_ld.0.http___schema_org_name.0._value');

```

Authors
-------

[](#authors)

[![](https://avatars0.githubusercontent.com/u/726519?s=40&v=4)](https://avatars0.githubusercontent.com/u/726519?s=40&v=4)

- **André Wuttig** - *Initial work, Unit Tests* - [aWuttig](https://github.com/aWuttig)

See also the list of [contributors](https://github.com/portrino/codeception-yandex-module/graphs/contributors) who participated in this project.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~25 days

Recently: every ~33 days

Total

7

Last Release

3138d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/03867e1d2497d7cb7feb932fb301387e143503bfd17c584ef90347b3d7942cf1?d=identicon)[portrino-dev](/maintainers/portrino-dev)

---

Top Contributors

[![aWuttig](https://avatars.githubusercontent.com/u/726519?v=4)](https://github.com/aWuttig "aWuttig (14 commits)")[![tgriessbach](https://avatars.githubusercontent.com/u/11647324?v=4)](https://github.com/tgriessbach "tgriessbach (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/portrino-codeception-yandex-module/health.svg)

```
[![Health](https://phpackages.com/badges/portrino-codeception-yandex-module/health.svg)](https://phpackages.com/packages/portrino-codeception-yandex-module)
```

###  Alternatives

[magento/magento2-functional-testing-framework

Magento2 Functional Testing Framework

15511.5M30](/packages/magento-magento2-functional-testing-framework)[oat-sa/tao-core

TAO core extension

66136.7k74](/packages/oat-sa-tao-core)[contributte/codeception

Integration of Nette framework to Codeception.

27886.9k1](/packages/contributte-codeception)[docler-labs/codeception-slim-module

Codeception Module for Slim framework.

13178.0k1](/packages/docler-labs-codeception-slim-module)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
