The production of Z bosons with one or two isolated high-energy photons is studied using $pp$ collisions at $\sqrt{s}$ = 8 TeV. The analyses use a data sample with an integrated luminosity of $20.3~fb^{-1}$ collected by the ATLAS detector during the 2012 data taking at the LHC. The data are used to make tests of the electroweak sector of the Standard Model (SM) and search for deviations that could provide evidence for new physics beyond SM. The $Z\gamma$ and $Z\gamma\gamma$ production cross sections are measured with leptonic decays of the Z boson and then compared to cross-section predictions from the SM. A high transverse energy of the photon in $\ell^{+}\ell^{-}\gamma$ and $\nu\bar{\nu}\gamma$ events was required to search for anomalous triple gauge-boson couplings $ZZ\gamma$ and $Z\gamma\gamma$, while the yields of events with high diphoton invariant mass from $\ell^{+}\ell^{-}\gamma\gamma$ and $\nu\bar{\nu}\gamma\gamma$ events are used to search for anomalous quartic gauge-boson couplings $ZZ\gamma\gamma$ and $Z\gamma\gamma\gamma$. No deviations from Standard Model predictions are observed and limits are placed on parameters used to describe anomalous gauge-boson couplings.