What are the Slack Archives?
Itβs a history of our time together in the Slack Community! Thereβs a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.
Because this space is not active, you wonβt be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..
hello, do you know if any good documentation about glue api testing exists?
Comments
-
@valerii.trots could you please help in the functional/e2e testing? π Iβm trying to test properly glue api, but there is not much (or I canβt find) documentation in this topic
0 -
Sorry, I'm not aware if such documentation exists but I do know who could know or could help maybe. Let's check if they got notified: @UQKSAARKN and @U017BL99B1V? π
0 -
thank you π
0 -
Unfortunately, there are no docs
0 -
@U017BL99B1V could you please in that case send some examples, or tell how to start with it? π
0 -
We test use just by using post/get requests. Here is an example:
/** * @param \PyzTest\Glue\ModuleNameRestApi\ModuleNameRestApiTester $i * * @return void */ public function testPostActionModuleNameRestApiTester $i): void { $i->sendPOST( '/' . ModuleNameRestApiConfig::RESOURCE_NAME, $this->getRequestData() ); $i->seeResponseCodeIs(Response::HTTP_OK); } /** * @return array[] */ private function getRequestData(): array { return [ 'data' => [ 'type' => ModuleNameRestApiConfig::RESOURCE_PING, 'attributes' => [], ], ]; }
0 -
And we use
seeResponseMatchesJsonType
for more assertions0 -
thank you
0 -
could you please also show yml configuration?
0 -
modules: enabled: - REST: depends: PhpBrowser part: Json
config: PhpBrowser: url: '%SPRYKER_GLUE_DOMAIN%' headers: Accept: application/json Content-Type: application/vnd.api+json
0 -
hmm SPRYKER_GLUE_DOMAIN is standard url, same as for current env, or sth different?
0 -
ah ok, it works!
0 -
thank you @U01A5ARAXP0
0 -
@USZB5JN4W Also, take a look on useful helpers
\SprykerTest\Glue\AuthRestApi\Helper\AuthRestApiHelper
\SprykerTest\Glue\Testify\Helper\GlueRest0 -
thanks π
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 76 Spryker News
- 927 Developer Corner
- 785 Spryker Development
- 88 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 35 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 26 Job Opportunities
- 3.2K π Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 70 Spryker Safari Questions
- 50 Random