File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
src/Magento/FunctionalTestingFramework/DataTransport/Auth Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -58,9 +58,14 @@ class WebApiAuth
5858 public static function getAdminToken ($ username = null , $ password = null )
5959 {
6060 $ login = $ username ?? getenv ('MAGENTO_ADMIN_USERNAME ' );
61- $ encryptedSecret = CredentialStore::getInstance ()->getSecret ('magento/MAGENTO_ADMIN_PASSWORD ' );
62- $ secret = CredentialStore::getInstance ()->decryptSecretValue ($ encryptedSecret );
63- $ password = $ password ?? $ secret ;
61+ try {
62+ $ encryptedSecret = CredentialStore::getInstance ()->getSecret ('magento/MAGENTO_ADMIN_PASSWORD ' );
63+ $ secret = CredentialStore::getInstance ()->decryptSecretValue ($ encryptedSecret );
64+ $ password = $ password ?? $ secret ;
65+ } catch (TestFrameworkException $ e ) {
66+ $ message = "Password not found in credentials file " ;
67+ throw new FastFailException ($ message . $ e ->getMessage (), $ e ->getContext ());
68+ }
6469 if (!$ login || !$ password ) {
6570 $ message = 'Cannot retrieve API token without credentials. Please fill out .env. ' ;
6671 $ context = [
You can’t perform that action at this time.
0 commit comments